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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions search behavior but lacks details on pagination (implied by parameters), rate limits, authentication needs, or output format. For a search tool with 9 parameters and no annotations, this is a significant gap in behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It front-loads the core purpose ('Search endpoints') and specifies key aspects (query targets) without unnecessary elaboration. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 9 parameters with full schema coverage but no annotations or output schema, the description is adequate for a search tool but lacks depth. It covers the basic action but misses behavioral context (e.g., pagination, authentication) and output details, leaving gaps for an AI agent to infer usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds minimal value by hinting at searchable fields (path, description, tags), which partially maps to the 'query' parameter but doesn't elaborate on others. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search') and target resource ('endpoints'), specifying searchable fields (path, description, tags). It distinguishes from siblings like 'list_endpoints' by emphasizing search functionality. However, it doesn't explicitly contrast with 'list_endpoints' which might also list endpoints without querying.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'list_endpoints' or 'get_endpoint_details'. The description implies usage for searching, but lacks explicit context, prerequisites, or exclusions. Sibling tools are not referenced to clarify differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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