Skip to main content
Glama
OpenAPI MCP Server

OpenAPI MCP Server

by matpb

get_openapi_spec

Retrieve the full OpenAPI spec or a filtered section, and filter paths by regex to inspect specific endpoints and components.

Instructions

Return the full OpenAPI spec or a filtered section. Use section to get specific parts (info, paths, components, tags, servers, full). Use pathFilter to filter paths by regex pattern. Platform guides are tags carrying an x-guide object with an id (a common naming is guide:); use list_guides, get_guide and search_docs to read them instead of dumping the spec.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_openapi_spec"
  }
}

Input Schema

NameRequiredDescriptionDefault
sectionNoSection to retrieve: info, paths, components, tags, servers, or full (default: full)
pathFilterNoRegex pattern to filter paths (e.g., '/users' to get all user-related endpoints)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden. It discloses that the default is the full spec, warns against dumping it wholesale, and explains that platform guides live in tags carrying an x-guide object with an id — useful structural context an agent would not otherwise know. It does not mention size/rate constraints or auth requirements, which keeps it short of a 5.

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

Conciseness4/5

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

Three front-loaded sentences with no filler; the primary capability comes first, parameters second, and the guide caveat last. The final sentence is dense but each clause carries actionable information, so little is wasted.

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?

For a two-parameter read tool with no output schema, the description covers selection, filtering, and the guide special case well. It leaves one ambiguity: whether pathFilter applies only when section is paths or full, and how the returned spec is shaped when a section is chosen.

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?

Schema description coverage is 100%, and the description largely restates what the schema already documents: the section value list and the pathFilter regex example appear in both places. The one addition is the guide/x-guide note, which is tangential to the parameters themselves. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Return the full OpenAPI spec') plus its scope ('or a filtered section'), and immediately distinguishes itself from the guide-reading siblings. An agent can tell what this retrieves without opening the schema.

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

Usage Guidelines5/5

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

Names the exact selector values for narrowing (info, paths, components, tags, servers, full), explains pathFilter's role with a concrete regex example, and explicitly redirects guide reading to list_guides, get_guide and search_docs 'instead of dumping the spec.' This is an explicit when-to-use and when-not-to-use statement with named alternatives.

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