Skip to main content
Glama

list_endpoints

Discover and filter API endpoints from OpenAPI schemas to analyze structure, find specific operations, and understand available resources without loading entire specifications.

Instructions

List all endpoints in an API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesAPI name or direct URL
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 of ListEndpointsTool that executes the core tool logic: validates API identifier, extracts pagination and filters, calls the explorer service for paginated endpoints, formats the output, and returns the MCP TextContent response.
    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.list_endpoints_paginated(
                arguments["api"], pagination, filters
            )
    
            result = self._format_paginated_endpoint_response(paginated_result, filters)
            return self._create_text_response(result)
        except Exception as e:
            return self._create_error_response(e)
  • Static method defining the JSON schema for list_endpoints tool input, including required 'api' identifier, optional pagination (page, page_size), and endpoint filters (methods, tags_include/exclude, has_authentication, deprecated).
    def create_paginated_endpoint_input_schema() -> Dict[str, Any]:
        """Create input schema for paginated endpoint operations."""
        schema = ToolDefinitionMixin.create_api_input_schema()
        schema["properties"].update(ToolDefinitionMixin.create_pagination_properties())
        schema["properties"].update(
            ToolDefinitionMixin.create_endpoint_filter_properties()
        )
        return schema
  • Instantiation of ListEndpointsTool with config_manager and explorer dependencies, added to the tools list in ToolRegistry._register_tools for MCP server registration.
    tools = [
        # API Management Tools
        AddApiTool(self.config_manager),
        ListSavedApisTool(self.config_manager),
        RemoveApiTool(self.config_manager),
        # API Exploration Tools
        GetApiInfoTool(self.config_manager, self.explorer),
        ListEndpointsTool(self.config_manager, self.explorer),
        SearchEndpointsTool(self.config_manager, self.explorer),
        GetEndpointDetailsTool(self.config_manager, self.explorer),
        ListModelsTool(self.config_manager, self.explorer),
        GetModelSchemaTool(self.config_manager, self.explorer),
    ]
  • Helper service method implementing pagination and optional filtering on top of list_endpoints, directly called by the tool handler.
    async def list_endpoints_paginated(
        self,
        api_identifier: str,
        pagination: PaginationParams,
        filters: Optional[EndpointFilterParams] = None,
    ) -> PaginationResult[EndpointInfo]:
        """List endpoints with pagination and filtering."""
        all_endpoints = await self.list_endpoints(api_identifier)
    
        if filters:
            filtered_endpoints = [
                ep for ep in all_endpoints if ep.matches_filters(filters)
            ]
        else:
            filtered_endpoints = all_endpoints
    
        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 endpoints for API {api_identifier}: "
            f"page {pagination.page}, showing {len(paginated_endpoints)} of {total_count}"
        )
    
        return PaginationResult.create(paginated_endpoints, total_count, pagination)
  • Core helper method that parses the OpenAPI schema to extract and construct EndpointInfo objects for all paths and valid HTTP methods, used by paginated version.
    async def list_endpoints(self, api_identifier: str) -> List[EndpointInfo]:
        """List all endpoints in an API."""
        url, headers = self.config_manager.get_api_config(api_identifier)
        schema = await self.cache.get_schema(url, headers)
    
        endpoints = []
        paths = schema.get("paths", {})
    
        for path, path_info in paths.items():
            for method, operation in path_info.items():
                if self._is_valid_http_method(method):
                    deprecated = operation.get("deprecated", False)
    
                    has_auth = bool(operation.get("security", [])) or bool(
                        schema.get("security", [])
                    )
    
                    endpoint = EndpointInfo(
                        path=path,
                        method=method.upper(),
                        summary=operation.get("summary"),
                        description=operation.get("description"),
                        tags=operation.get("tags", []),
                        operation_id=operation.get("operationId"),
                        deprecated=deprecated,
                        has_authentication=has_auth,
                    )
                    endpoints.append(endpoint)
    
        logger.info(f"Found {len(endpoints)} endpoints for API {api_identifier}")
        return endpoints
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 for behavioral disclosure. It states 'List all endpoints' but doesn't mention pagination behavior (implied by parameters), rate limits, authentication requirements, or what 'all' means in practice (e.g., completeness guarantees). For a tool with 8 parameters and no annotation coverage, this leaves significant behavioral gaps.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a listing tool and front-loads the core functionality. Every word earns its place.

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

Completeness2/5

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

For a tool with 8 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the return format, pagination behavior, or how filtering parameters interact. The agent must rely entirely on the input schema for operational details, which is insufficient for contextual understanding of this complex listing tool.

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 the schema fully documents all 8 parameters. The description adds no parameter-specific information beyond the generic 'List all endpoints in an API' statement. According to guidelines, baseline is 3 when schema does the heavy lifting, even without additional param details in the description.

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 ('List') and resource ('endpoints in an API'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search_endpoints' or 'get_endpoint_details', which would require more specificity about scope or filtering capabilities.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'search_endpoints' and 'get_endpoint_details' available, there's no indication whether this is for comprehensive listing, filtered queries, or detailed endpoint information. The agent must infer usage from the tool name alone.

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