Skip to content

search_public_records

search_public_records(
    *,
    config_overrides: Optional[AgentDiscoveryClientConfig] = None,
    search_query: Optional[searchQuery] = None,
    filters: Optional[SearchFilterExpression] = None,
    max_results: Optional[maxResults] = None,
    next_token: Optional[nextToken] = None,
) -> SearchPublicRecordsResponse

Search public agent records across the authoritative + crawler indexes. Hybrid keyword + neural ranking, merged and fused (weighted RRF), with filters, org governance policy, and descriptor-visibility enforcement applied server-side. Public, authenticated (D-1).

Parameters:

  • search_query (Optional[searchQuery], default: None ) –

    Free-text natural-language query (ARD text). Drives semantic + lexical ranking.

  • filters (Optional[SearchFilterExpression], default: None ) –

    Structured filter narrowing the results, in the grammar of Agent Registry's SearchDiscoverableRegistryRecords filters: $eq, $ne and $in on a field, with $and or $or over single-condition objects, never nested. Fields are identifier, domain, recordType, descriptorType, provenance and recordVersion, and identifier also takes $prefix. For example {"recordType": {"$eq": "AGENT"}} or {"$or": [{"recordType": {"$eq": "MCP"}}, {"domain": {"$eq": "acme.com"}}]}.

    Limits, the same ones Agent Registry applies: at most 10 conditions, $in takes 1-25 values, values are strings of 1-512 characters, and {} is invalid. A document can't carry @length, so the service enforces these and answers a filter past them with a ValidationException, as Agent Registry does.

  • max_results (Optional[maxResults], default: None ) –

    Max records per page. Default 20, max 100.

  • next_token (Optional[nextToken], default: None ) –

    Opaque composite-cursor pagination token (O-DM12).

Raises:

  • InternalServerException –

    Thrown on an internal defect — a bug or malformed state, not a failed dependency.

    ⚠️ Deliberately a permanent failure. Repeating a request that failed to serialize will fail identically, so treating a 500 as retryable would spin a poison message through redelivery forever instead of letting it reach a dead-letter queue. Dependency failures that are worth retrying use ServiceUnavailableException and its 503 instead.

  • ThrottlingException –

    Thrown when the caller exceeds a rate/burst limit (D-9). ARD's code for it is RATE_LIMIT_EXCEEDED.

  • ValidationException –

    Thrown when a request fails input validation.

    errorCode carries ARD's Appendix B code, INVALID_ARGUMENT, which ARD's OpenAPI makes a required member of every error body on the ARD surface. The Amazon-shaped and internal surfaces leave it unset.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To search for agents by keyword The following example searches public records for flight booking agents and returns the first match.

>>> client.search_public_records(search_query='book a flight', filters={'recordType': {'$eq': 'AGENT'}}, max_results=1)
Source code in docs_src/capo_agent_discovery/_services/agent_discovery.py
def search_public_records(
    self,
    *,
    config_overrides: Optional[AgentDiscoveryClientConfig] = None,
    search_query: Optional[
        "capo_agent_discovery.types.search_query.searchQuery"
    ] = None,
    filters: Optional[
        "capo_agent_discovery.types.search_filter_expression.SearchFilterExpression"
    ] = None,
    max_results: Optional[
        "capo_agent_discovery.types.max_results.maxResults"
    ] = None,
    next_token: Optional["capo_agent_discovery.types.next_token.nextToken"] = None,
) -> "capo_agent_discovery.types.search_public_records_response.SearchPublicRecordsResponse":
    """Search public agent records across the authoritative + crawler indexes. Hybrid keyword + neural ranking, merged and fused (weighted RRF), with filters, org governance policy, and descriptor-visibility enforcement applied server-side. Public, authenticated (D-1).

    Args:
        search_query: Free-text natural-language query (ARD `text`). Drives semantic + lexical ranking.
        filters: Structured filter narrowing the results, in the grammar of Agent Registry's SearchDiscoverableRegistryRecords `filters`: `$eq`, `$ne` and `$in` on a field, with `$and` or `$or` over single-condition objects, never nested. Fields are `identifier`, `domain`, `recordType`, `descriptorType`, `provenance` and `recordVersion`, and `identifier` also takes `$prefix`. For example `{"recordType": {"$eq": "AGENT"}}` or `{"$or": [{"recordType": {"$eq": "MCP"}}, {"domain": {"$eq": "acme.com"}}]}`. <p>Limits, the same ones Agent Registry applies: at most 10 conditions, `$in` takes 1-25 values, values are strings of 1-512 characters, and `{}` is invalid. A `document` can't carry `@length`, so the service enforces these and answers a filter past them with a ValidationException, as Agent Registry does.
        max_results: Max records per page. Default 20, max 100.
        next_token: Opaque composite-cursor pagination token (O-DM12).

    Raises:
        capo_agent_discovery.errors.internal_server_exception.InternalServerException: Thrown on an internal defect — a bug or malformed state, not a failed dependency. <p>⚠️ Deliberately a **permanent** failure. Repeating a request that failed to serialize will fail identically, so treating a 500 as retryable would spin a poison message through redelivery forever instead of letting it reach a dead-letter queue. Dependency failures that *are* worth retrying use `ServiceUnavailableException` and its 503 instead.
        capo_agent_discovery.errors.throttling_exception.ThrottlingException: Thrown when the caller exceeds a rate/burst limit (D-9). ARD's code for it is `RATE_LIMIT_EXCEEDED`.
        capo_agent_discovery.errors.validation_exception.ValidationException: Thrown when a request fails input validation. <p>`errorCode` carries ARD's Appendix B code, `INVALID_ARGUMENT`, which ARD's OpenAPI makes a required member of every error body on the ARD surface. The Amazon-shaped and internal surfaces leave it unset.
        capo_agent_discovery.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To search for agents by keyword
        The following example searches public records for flight booking agents and returns the first match.

        >>> client.search_public_records(search_query='book a flight', filters={'recordType': {'$eq': 'AGENT'}}, max_results=1)
    """

    def _handler(
        req: "OperationRequest[capo_agent_discovery.types.search_public_records_request.SearchPublicRecordsRequest]",
    ) -> OperationResponse[
        "capo_agent_discovery.types.search_public_records_response.SearchPublicRecordsResponse"
    ]:
        import capo_agent_discovery._operations.belfry_global_dp.search_public_records

        output, http_response = (
            capo_agent_discovery._operations.belfry_global_dp.search_public_records.search_public_records(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchPublicRecords")
    )
    input_: capo_agent_discovery.types.search_public_records_request.SearchPublicRecordsRequest = {}
    if search_query is not None:
        input_["search_query"] = search_query
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output