list_endpoints
Discover available API endpoints by fetching and parsing Swagger/OpenAPI documentation to explore API capabilities.
Instructions
List all available API endpoints after fetching Swagger documentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.js:476-503 (handler)Core handler function that iterates over swaggerDoc.paths, identifies HTTP methods, and constructs a list of endpoints with path, method, summary, operationId, and tags.function listEndpoints() { if (!swaggerDoc) { throw new Error('Swagger documentation not loaded. Call fetch_swagger_info first.'); } const endpoints = []; const paths = swaggerDoc.paths || {}; for (const path in paths) { const methods = Object.keys(paths[path]).filter(key => ['get', 'post', 'put', 'delete', 'patch', 'options', 'head'].includes(key.toLowerCase()) ); methods.forEach(method => { const operation = paths[path][method]; endpoints.push({ path, method: method.toUpperCase(), summary: operation.summary || '', operationId: operation.operationId || '', tags: operation.tags || [] }); }); } return endpoints; }
- src/server.js:169-177 (registration)Tool registration in the tools array, including name, description, and empty input schema (no parameters required). This object is used in server capabilities.{ name: "list_endpoints", description: "List all available API endpoints after fetching Swagger documentation", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/server.js:172-176 (schema)Input schema definition for the list_endpoints tool: an empty object (no input parameters).inputSchema: { type: "object", properties: {}, required: [], },
- src/server.js:990-1007 (handler)Dispatch handler in the CallToolRequestSchema switch statement that checks for swaggerDoc, calls listEndpoints(), and returns the JSON-formatted result as tool content.case "list_endpoints": { try { if (!swaggerDoc) { throw new Error('Swagger documentation not loaded. Call fetch_swagger_info first.'); } const endpoints = listEndpoints(); return { content: [{ type: "text", text: JSON.stringify(endpoints) }], isError: false, }; } catch (error) { throw new Error(`Failed to list endpoints: ${error.message}`); } }