searchRegistryRecords method

Future<SearchRegistryRecordsResponse> searchRegistryRecords({
  1. required List<String> registryIds,
  2. required String searchQuery,
  3. Object? filters,
  4. int? maxResults,
})

Searches for registry records using semantic, lexical, or hybrid queries. Returns metadata for matching records ordered by relevance within the specified registry.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnauthorizedException. May throw ValidationException.

Parameter registryIds : The list of registry identifiers to search within. Currently, you can specify exactly one registry identifier. You can provide either the full Amazon Web Services Resource Name (ARN) or the 12-character alphanumeric registry ID.

Parameter searchQuery : The search query to find matching registry records.

Parameter filters : A metadata filter expression to narrow search results. Uses structured JSON operators including field-level operators ($eq, $ne, $in) and logical operators ($and, $or) on filterable fields (name, descriptorType, version). For example, to filter by descriptor type: {"descriptorType": {"$eq": "MCP"}}. To combine filters: {"$and": [{"descriptorType": {"$eq": "MCP"}}, {"name": {"$eq": "my-tool"}}]}.

Parameter maxResults : The maximum number of records to return in a single call. Valid values are 1 through 20. The default value is 10.

Implementation

Future<SearchRegistryRecordsResponse> searchRegistryRecords({
  required List<String> registryIds,
  required String searchQuery,
  Object? filters,
  int? maxResults,
}) async {
  final $payload = <String, dynamic>{
    'registryIds': registryIds,
    'searchQuery': searchQuery,
    if (filters != null) 'filters': filters,
    if (maxResults != null) 'maxResults': maxResults,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/registry-records/search',
    exceptionFnMap: _exceptionFns,
  );
  return SearchRegistryRecordsResponse.fromJson(response);
}