get_endpoint_info
Retrieve detailed information for a specific REST API endpoint by providing its path and HTTP method.
Instructions
Get detailed information about a specific endpoint
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Endpoint path | |
| method | Yes | HTTP method |
Implementation Reference
- src/index.ts:364-381 (handler)The getEndpointInfo handler method in the McpRestServer class - validates restClient exists, extracts path/method from args, calls restClient.getEndpointInfo(), and returns the result as text content.
private async getEndpointInfo(args: any) { if (!this.restClient) { throw new Error( "REST client not configured. Use configure_rest_client tool or provide configuration via CLI/environment variables." ); } const { path, method } = args; const info = this.restClient.getEndpointInfo(path, method); return { content: [ { type: "text", text: info, }, ], }; } - src/index.ts:182-199 (schema)Tool registration with inputSchema - defines get_endpoint_info with required 'path' (string) and 'method' (string) parameters.
{ name: "get_endpoint_info", description: "Get detailed information about a specific endpoint", inputSchema: { type: "object", properties: { path: { type: "string", description: "Endpoint path", }, method: { type: "string", description: "HTTP method", }, }, required: ["path", "method"], }, }, - src/index.ts:237-238 (registration)Tool routing in CallToolRequestSchema handler - routes 'get_endpoint_info' calls to this.getEndpointInfo(args).
case "get_endpoint_info": return await this.getEndpointInfo(args); - src/rest-client.ts:203-227 (helper)The RestClient.getEndpointInfo method that delegates to SwaggerDocumentationParser.getEndpoint() and formats the endpoint details (summary, description, parameters) into a readable string.
getEndpointInfo(path: string, method: string): string { if (!this.swaggerParser) { return "Swagger documentation not configured"; } const endpoint = this.swaggerParser.getEndpoint(path, method); if (!endpoint) { return `Endpoint ${method} ${path} not found`; } let info = `${endpoint.method} ${endpoint.path}\n`; if (endpoint.summary) info += `Summary: ${endpoint.summary}\n`; if (endpoint.description) info += `Description: ${endpoint.description}\n`; if (endpoint.parameters && endpoint.parameters.length > 0) { info += "\nParameters:\n"; endpoint.parameters.forEach((param) => { info += ` - ${param.name} (${param.in})${ param.required ? " *required*" : "" }: ${param.description || "No description"}\n`; }); } return info; } - src/swagger.ts:122-128 (helper)The SwaggerDocumentationParser.getEndpoint method - the lowest-level lookup that finds a SwaggerEndpoint by path and method in the parsed endpoints array.
getEndpoint(path: string, method: string): SwaggerEndpoint | undefined { return this.endpoints.find( (endpoint) => endpoint.path === path && endpoint.method.toLowerCase() === method.toLowerCase() ); }