Skip to main content
Glama

list_endpoints

Retrieve all API endpoints by extracting and displaying details from Swagger/OpenAPI documentation for exploration and testing.

Instructions

List all available API endpoints after fetching Swagger documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.js:169-177 (registration)
    Registers the 'list_endpoints' tool in the MCP tools array, including its description and empty input schema (no parameters required).
    { name: "list_endpoints", description: "List all available API endpoints after fetching Swagger documentation", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Defines the input schema for the 'list_endpoints' tool: an empty object (no input parameters).
    inputSchema: { type: "object", properties: {}, required: [], },
  • The core handler function that extracts and formats the list of API endpoints from the loaded Swagger documentation (paths, methods, summaries, operationIds, 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; }
  • MCP request handler case for 'list_endpoints' tool: checks swaggerDoc, calls listEndpoints(), and returns JSON stringified result in the required MCP response format.
    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}`); } }

Other Tools

Related 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/amrsa1/swagger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server