Skip to main content
Glama

get_endpoint_details

Retrieve comprehensive details about a specific API endpoint, including path and HTTP method, to facilitate API exploration and testing.

Instructions

Get detailed information about a specific API endpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYesThe HTTP method (GET, POST, PUT, DELETE, etc.)
pathYesThe endpoint path to get details for (e.g., '/users/{id}')

Implementation Reference

  • The core handler function that implements the get_endpoint_details tool logic. It extracts and formats detailed information about a specific API endpoint (parameters, requestBody, responses, etc.) from the loaded Swagger documentation.
    function getEndpointDetails(path, method) { if (!swaggerDoc) { throw new Error('Swagger documentation not loaded. Call fetch_swagger_info first.'); } const paths = swaggerDoc.paths || {}; method = method.toLowerCase(); if (!paths[path] || !paths[path][method]) { throw new Error(`Endpoint ${method.toUpperCase()} ${path} not found in the Swagger documentation`); } const endpoint = paths[path][method]; const parameters = endpoint.parameters || []; const responses = endpoint.responses || {}; const formattedResponses = {}; for (const statusCode in responses) { formattedResponses[statusCode] = { description: responses[statusCode].description || '', schema: responses[statusCode].schema || null, examples: responses[statusCode].examples || null }; } return { summary: endpoint.summary || '', description: endpoint.description || '', operationId: endpoint.operationId || '', parameters, requestBody: endpoint.requestBody || null, responses: formattedResponses, consumes: endpoint.consumes || swaggerDoc.consumes || ['application/json'], produces: endpoint.produces || swaggerDoc.produces || ['application/json'] }; }
  • Input schema definition for the get_endpoint_details tool, specifying path and method as required string parameters with descriptions.
    inputSchema: { type: "object", properties: { path: { type: "string", description: "The endpoint path to get details for (e.g., '/users/{id}')" }, method: { type: "string", description: "The HTTP method (GET, POST, PUT, DELETE, etc.)" } }, required: ["path", "method"], },
  • src/server.js:178-195 (registration)
    Tool registration in the tools array, including name, description, and inputSchema. This is used in server capabilities to advertise the tool to MCP clients.
    { name: "get_endpoint_details", description: "Get detailed information about a specific API endpoint", inputSchema: { type: "object", properties: { path: { type: "string", description: "The endpoint path to get details for (e.g., '/users/{id}')" }, method: { type: "string", description: "The HTTP method (GET, POST, PUT, DELETE, etc.)" } }, required: ["path", "method"], }, },
  • MCP request handler registration for get_endpoint_details within the CallToolRequestSchema switch. Extracts arguments, validates, calls the handler, and formats the response.
    case "get_endpoint_details": { const path = request.params.arguments?.path; const method = request.params.arguments?.method; if (!path || !method) { throw new Error("Both path and method are required"); } try { const details = getEndpointDetails(path, method); return { content: [{ type: "text", text: JSON.stringify(details) }], isError: false, }; } catch (error) { throw new Error(`Failed to get endpoint details: ${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