Skip to main content
Glama

search_endpoints

Find API endpoints by searching path, description, or tags within OpenAPI schemas. Filter results by HTTP methods, authentication requirements, tags, and deprecation status.

Instructions

Search endpoints by query in path, description, or tags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesAPI name or direct URL
queryYesSearch query
pageNoPage number (1-based)
page_sizeNoItems per page (max 100)
methodsNoFilter by HTTP methods (e.g., ['GET', 'POST'])
tags_includeNoInclude endpoints with these tags
tags_excludeNoExclude endpoints with these tags
has_authenticationNoFilter by authentication requirement
deprecatedNoFilter by deprecation status

Implementation Reference

  • The handle_call method implements the core logic of the search_endpoints tool. It validates the API identifier, extracts pagination and filter parameters, calls the explorer service for paginated search results, formats the response, and handles errors.
    async def handle_call(self, arguments: Dict[str, Any]) -> List[TextContent]: try: self._validate_api_identifier(arguments["api"]) pagination = self.extract_pagination_params(arguments) filters = self.extract_endpoint_filter_params(arguments) paginated_result = await self.explorer.search_endpoints_paginated( arguments["api"], arguments["query"], pagination, filters ) result = self._format_paginated_search_response( paginated_result, arguments["query"], filters ) return self._create_text_response(result) except Exception as e: return self._create_error_response(e)
  • Defines the tool definition including name, description, and input schema for the search_endpoints tool using create_paginated_search_input_schema().
    def get_tool_definition(self) -> Tool: return Tool( name=self.name, description=self.description, inputSchema=self.create_paginated_search_input_schema(), )
  • Instantiates the SearchEndpointsTool with config_manager and explorer, adding it to the list of tools registered in the ToolRegistry.
    SearchEndpointsTool(self.config_manager, self.explorer),
  • The search_endpoints_paginated method in OpenAPIExplorer performs the actual endpoint searching, filtering by query and additional filters, applies pagination, and returns a PaginationResult. This is called by the tool handler.
    async def search_endpoints_paginated( self, api_identifier: str, query: str, pagination: PaginationParams, filters: Optional[EndpointFilterParams] = None, ) -> PaginationResult[EndpointInfo]: """Search endpoints with pagination and filtering.""" all_endpoints = await self.list_endpoints(api_identifier) query_filtered = [ep for ep in all_endpoints if ep.matches_query(query)] if filters: filtered_endpoints = [ ep for ep in query_filtered if ep.matches_filters(filters) ] else: filtered_endpoints = query_filtered total_count = len(filtered_endpoints) start_idx = pagination.get_offset() end_idx = start_idx + pagination.get_limit() paginated_endpoints = filtered_endpoints[start_idx:end_idx] logger.info( f"Paginated search for '{query}' in API {api_identifier}: " f"page {pagination.page}, showing {len(paginated_endpoints)} of {total_count}" ) return PaginationResult.create(paginated_endpoints, total_count, pagination)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nyudenkov/openapi-mcp-proxy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server