get_endpoint_schema
Retrieve OpenAPI schema for specific API endpoints to understand request parameters, response structures, and required fields for development.
Instructions
šÆ GET PRECISE ENDPOINT SCHEMA - Returns exact OpenAPI schema for specific endpoints.
Perfect for when you need:
⢠Exact request parameter names and types
⢠Response field names and structures
⢠Required vs optional parameters
⢠Related endpoints for the same use case
Example queries this replaces:
⢠"bills endpoint response schema fields amount vendor status" ā Use this tool with /developer/v1/bills
⢠"API pagination limit page_size next cursor" ā Get schema for any paginated endpoint
⢠"cards creation request parameters" ā Use this tool with /developer/v1/cards
Usage: Provide an endpoint path (and optionally method) to get the complete technical specification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | The endpoint path (e.g., '/developer/v1/bills', '/developer/v1/limits') | |
| method | No | HTTP method (GET, POST, PUT, etc.). If not specified, will show most relevant method. | |
| include_related | No | Include related endpoints for the same use case |
Implementation Reference
- src/tools/get_endpoint_schema.py:83-118 (handler)Main execution handler that parses input, finds matching endpoints, handles errors, and formats the schema response as TextContent.async def execute(self, arguments: Dict[str, Any]) -> List[TextContent]: """Execute schema retrieval""" endpoint = arguments.get("endpoint", "").strip() method = arguments.get("method", "").upper() if arguments.get("method") else None include_related = arguments.get("include_related", True) if not endpoint: return [TextContent( type="text", text="ā Please provide an endpoint path (e.g., '/developer/v1/bills')" )] try: # Find matching endpoint(s) matching_endpoints = self._find_matching_endpoints(endpoint, method) if not matching_endpoints: similar = self._find_similar_endpoints(endpoint) suggestion_text = f"\n\n**Similar endpoints available:**\n" + "\n".join([f"⢠{ep}" for ep in similar[:5]]) if similar else "" return [TextContent( type="text", text=f"ā Endpoint not found: `{method + ' ' if method else ''}{endpoint}`{suggestion_text}" )] # Format the schema response result_text = self._format_endpoint_schemas(matching_endpoints, include_related) return [TextContent(type="text", text=result_text)] except Exception as e: return [TextContent( type="text", text=f"ā Error retrieving schema: {str(e)}" )]
- Input schema defining the tool's parameters: endpoint (required string), optional method (enum), and include_related (boolean).def input_schema(self) -> Dict[str, Any]: return { "type": "object", "properties": { "endpoint": { "type": "string", "description": "The endpoint path (e.g., '/developer/v1/bills', '/developer/v1/limits')" }, "method": { "type": "string", "description": "HTTP method (GET, POST, PUT, etc.). If not specified, will show most relevant method.", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] }, "include_related": { "type": "boolean", "default": True, "description": "Include related endpoints for the same use case" } }, "required": ["endpoint"] }
- src/server.py:46-51 (registration)Registration of GetEndpointSchemaTool instance in the server's tools list, passed to MCP server handlers.tools = [ PingTool(), SearchDocumentationTool(knowledge_base), SubmitFeedbackTool(), GetEndpointSchemaTool(knowledge_base) ]
- src/server.py:29-29 (registration)Import statement bringing GetEndpointSchemaTool into the server module.from tools import PingTool, SearchDocumentationTool, SubmitFeedbackTool, GetEndpointSchemaTool
- Tool name property returning 'get_endpoint_schema', used for registration and invocation.def name(self) -> str: return "get_endpoint_schema"