Skip to main content
Glama
ProsodyAI

@prosodyai/mcp-docs

Official
by ProsodyAI

Get a REST endpoint

get_endpoint

Retrieve the complete OpenAPI operation object (parameters, request body, responses, security) for any REST endpoint by providing its HTTP method and path template.

Instructions

Get the full OpenAPI operation object (parameters, request body, responses, security) for a single REST endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYesHTTP method, e.g. `POST`.
pathYesOpenAPI path template, e.g. `/v1/analyze/audio`.

Implementation Reference

  • The core handler function 'getEndpoint' that looks up an OpenAPI operation by HTTP method and path from the cached OpenAPI spec. Returns the method, path, and full operation object, or null if not found.
    export async function getEndpoint(method: string, path: string): Promise<{
      method: string;
      path: string;
      operation: OpenApiOperation;
    } | null> {
      const spec = await loadOpenApi();
      const op = spec?.paths?.[path]?.[method.toLowerCase()];
      if (!op) return null;
      return { method: method.toUpperCase(), path, operation: op };
    }
  • TypeScript type 'OpenApiOperation' used as the return type for the endpoint operation data, defining the shape (summary, description, tags, parameters, requestBody, responses, security, operationId).
    interface OpenApiOperation {
      summary?: string;
      description?: string;
      tags?: string[];
      parameters?: unknown[];
      requestBody?: unknown;
      responses?: Record<string, unknown>;
      security?: unknown[];
      operationId?: string;
    }
  • src/server.ts:171-187 (registration)
    Tool registration for 'get_endpoint' via server.registerTool, including the input schema (method and path) and the handler that calls getEndpoint() and returns a JSON response.
    server.registerTool(
      "get_endpoint",
      {
        title: "Get a REST endpoint",
        description:
          "Get the full OpenAPI operation object (parameters, request body, responses, security) for a single REST endpoint.",
        inputSchema: {
          method: z.string().describe("HTTP method, e.g. `POST`."),
          path: z.string().describe("OpenAPI path template, e.g. `/v1/analyze/audio`."),
        },
      },
      async ({ method, path }) => {
        const result = await getEndpoint(method, path);
        if (!result) return textResponse(`No endpoint ${method.toUpperCase()} ${path}.`);
        return jsonResponse(result);
      },
    );
  • Helper function 'loadOpenApi' that loads and caches the OpenAPI spec from the content store — called by getEndpoint to retrieve the spec.
    export async function loadOpenApi(): Promise<OpenApiSpec | null> {
      if (cached) return cached;
      const entry = await getEntry("api/openapi");
      if (!entry) return null;
      try {
        cached = JSON.parse(entry.body) as OpenApiSpec;
        return cached;
      } catch {
        return null;
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the return content but does not explicitly confirm read-only behavior, authentication needs, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently communicates the tool's purpose and return value without any redundancy or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description mentions the key components of the return object (parameters, request body, responses, security). While no output schema exists, this is sufficient for a simple retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% coverage with descriptions for both parameters. The description adds no additional semantic information beyond implying the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the full OpenAPI operation object for a single REST endpoint, specifying included components. This distinguishes it from siblings like list_endpoints (list all) and get_openapi (full spec).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for a single endpoint but does not explicitly state when to use this vs alternatives like list_endpoints for discovery or get_openapi for the full spec.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/ProsodyAI/mcp-docs'

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