Skip to main content
Glama

get_endpoint_details

Retrieve comprehensive information about specific API endpoints, including parameters, schemas, and responses, from OpenAPI specifications without loading entire schemas.

Instructions

Get detailed information about a specific endpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesAPI name or direct URL
pathYesEndpoint path
methodYesHTTP method
include_responsesNoWhether to include responses in details. Use it, for example, to get full details for a specific endpoint or pass False to get a summary.

Implementation Reference

  • Core handler function in OpenAPIExplorer that fetches detailed endpoint information from the schema, including parameters, request body, security, and optionally responses.
    async def get_endpoint_details(
        self,
        api_identifier: str,
        path: str,
        method: str,
        include_responses: bool = True,
    ) -> Dict[str, Any]:
        """Get detailed information about a specific endpoint."""
        url, headers = self.config_manager.get_api_config(api_identifier)
        schema = await self.cache.get_schema(url, headers)
    
        paths = schema.get("paths", {})
        if path not in paths:
            raise ValueError(f"Path '{path}' not found")
    
        path_info = paths[path]
        method_lower = method.lower()
    
        if method_lower not in path_info:
            raise ValueError(f"Method '{method}' not found for path '{path}'")
    
        operation = path_info[method_lower]
    
        details = {
            "path": path,
            "method": method.upper(),
            "summary": operation.get("summary"),
            "description": operation.get("description"),
            "tags": operation.get("tags", []),
            "operation_id": operation.get("operationId"),
            "parameters": operation.get("parameters", []),
            "request_body": operation.get("requestBody"),
            "security": operation.get("security", []),
        }
    
        if include_responses:
            details["responses"] = operation.get("responses", {})
    
        logger.info(f"Retrieved details for {method.upper()} {path}")
        return details
  • Defines the JSON schema for the tool's input parameters: api, path, method, and optional include_responses.
    def create_endpoint_details_input_schema() -> Dict[str, Any]:
        """Create input schema for endpoint details."""
        return {
            "type": "object",
            "properties": {
                "api": {"type": "string", "description": "API name or direct URL"},
                "path": {"type": "string", "description": "Endpoint path"},
                "method": {"type": "string", "description": "HTTP method"},
                "include_responses": {
                    "type": "boolean",
                    "description": "Whether to include responses in details. Use it, for example, to get full details for a specific endpoint or pass False to get a summary.",
                    "default": True,
                },
            },
            "required": ["api", "path", "method"],
        }
  • MCP Tool class definition including name, description, input schema reference, and handle_call that delegates to the explorer service.
    class GetEndpointDetailsTool(APITool, ToolDefinitionMixin):
        """Tool for getting detailed endpoint information."""
    
        def __init__(self, config_manager, explorer):
            super().__init__(
                name="get_endpoint_details",
                description="Get detailed information about a specific endpoint",
                config_manager=config_manager,
                explorer=explorer,
            )
    
        def get_tool_definition(self) -> Tool:
            return Tool(
                name=self.name,
                description=self.description,
                inputSchema=self.create_endpoint_details_input_schema(),
            )
    
        async def handle_call(self, arguments: Dict[str, Any]) -> List[TextContent]:
            try:
                self._validate_api_identifier(arguments["api"])
                details = await self.explorer.get_endpoint_details(
                    arguments["api"],
                    arguments["path"],
                    arguments["method"],
                    arguments.get("include_responses", True),
                )
                result = self.explorer.format_endpoint_details(details)
                return self._create_text_response(result)
            except Exception as e:
                return self._create_error_response(e)
  • Registers the GetEndpointDetailsTool instance in the central tool registry along with other tools.
    def _register_tools(self) -> None:
        """Register all available tools."""
        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),
        ]
    
        for tool in tools:
            self._tools[tool.name] = tool
            logger.debug(f"Registered tool: {tool.name}")
  • Helper method to format the endpoint details output for user-friendly display, used by the tool's handle_call.
    def format_endpoint_details(self, details: Dict[str, Any]) -> str:
        """Format endpoint details for display."""
        result = f"{details['method']} {details['path']}\n"
        if details["summary"]:
            result += f"Summary: {details['summary']}\n"
        if details["description"]:
            result += f"Description: {details['description']}\n"
        if details["tags"]:
            result += f"Tags: {', '.join(details['tags'])}\n"
    
        result += f"\nFull schema:\n{json.dumps(details, indent=2)}"
        return result
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation, implying it's likely read-only, but doesn't confirm safety aspects like whether it requires authentication, has rate limits, or what format the detailed information returns. For a tool with 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 any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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?

Given no annotations and no output schema, the description is incomplete for a tool that retrieves 'detailed information'. It doesn't specify what details are included, the response format, or error conditions. With 4 parameters and complex sibling tools, more context is needed for the agent to use this effectively.

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 already documents all four parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema (e.g., it doesn't explain relationships between 'api', 'path', and 'method', or provide examples). Baseline 3 is appropriate when 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 verb ('Get') and resource ('detailed information about a specific endpoint'), making the purpose unambiguous. However, it doesn't distinguish this tool from sibling tools like 'get_api_info' or 'search_endpoints' that might also retrieve endpoint-related information, so it doesn't reach the highest clarity level.

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 like 'get_api_info', 'list_endpoints', or 'search_endpoints'. It mentions no prerequisites, exclusions, or specific contexts, leaving the agent with minimal usage direction.

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