Skip to main content
Glama

search_endpoints

Locate specific API endpoints by searching paths, descriptions, or tags within OpenAPI schemas. Filter by HTTP methods, authentication, deprecation status, or include/exclude tags for precise results.

Instructions

Search endpoints by query in path, description, or tags

Input Schema

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

Implementation Reference

  • The handle_call method of SearchEndpointsTool, which implements the core execution logic for the 'search_endpoints' tool: validates input, extracts pagination and filters, calls the explorer service's paginated search, formats the response, and returns it.
    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)
  • The get_tool_definition method defining the tool's schema, including inputSchema for validation via 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(), )
  • Instantiation and registration of SearchEndpointsTool in the tool registry's _register_tools method.
    SearchEndpointsTool(self.config_manager, self.explorer),
  • The search_endpoints_paginated helper method in OpenAPIExplorer, implementing the actual search logic: lists all endpoints, filters by query and additional filters, applies pagination, and returns results.
    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)
  • The non-paginated search_endpoints helper method, which lists endpoints and filters by query.
    async def search_endpoints( self, api_identifier: str, query: str ) -> List[EndpointInfo]: """Search endpoints by query in path, description, or tags.""" endpoints = await self.list_endpoints(api_identifier) filtered = [endpoint for endpoint in endpoints if endpoint.matches_query(query)] logger.info( f"Found {len(filtered)} endpoints matching '{query}' for API {api_identifier}" ) return filtered

Other Tools

Related Tools

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