Skip to main content
Glama
anuoua

swagger-doc-explorer-mcp

by anuoua

Load Swagger/OpenAPI Spec

swagger_load_spec
Read-only

Load an OpenAPI/Swagger JSON spec from a URL to start exploring API documentation. Fetches and parses the spec, storing it for endpoint and schema browsing.

Instructions

Load and parse an OpenAPI (Swagger) specification document from a URL.

This tool fetches a JSON OpenAPI/Swagger spec from the given URL and stores it in memory for subsequent exploration. You must load a spec before using any other tools.

Each loaded spec is assigned a unique name (title + version). If a spec with the same name already exists, a numeric suffix is appended.

Args:

  • url (string): URL to the OpenAPI/Swagger JSON spec (e.g., "https://petstore.swagger.io/v2/swagger.json")

  • auth_header (string, optional): Authorization header value for protected specs (e.g., "Bearer token123" or "Basic base64encoded"). Only needed for authenticated endpoints.

Returns: { "spec_name": string, // The assigned spec name for subsequent tools "title": string, // API title from the spec "version": string, // API version from the spec "description": string, // API description (if available) "endpoints": number, // Total number of API endpoints found "schemas": number, // Total number of schemas/components found "tags": number, // Total number of unique tags found "server_url": string // Base server URL from the spec }

Examples:

Error Handling:

  • Returns error if URL is unreachable or times out

  • Returns error if the document is not valid OpenAPI/Swagger JSON

  • Returns error if YAML format is provided (only JSON is supported)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to the OpenAPI/Swagger JSON spec (e.g., 'https://petstore.swagger.io/v2/swagger.json')
auth_headerNoAuthorization header value for protected specs (e.g., 'Bearer eyJhbGci...' or 'Basic base64string'). Only needed if the spec requires authentication.
Behavior5/5

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

Beyond annotations (readOnlyHint, destructiveHint), the description explains in-memory storage, unique name assignment with numeric suffix for duplicates, and error behavior for unreachable URLs, invalid JSON, and unsupported YAML. This adds meaningful behavioral context.

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 well-structured with clear sections (Args, Returns, Examples, Error Handling) and front-loaded with a one-sentence summary. While detailed, every section adds necessary information for a tool that is a prerequisite for all others.

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

Completeness5/5

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

The description provides a complete return object schema, explains the tool's role in the overall workflow, and covers likely failure modes. Since there is no output schema, this level of detail is necessary and fully provided.

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?

Both parameters are fully described in the input schema (100% coverage) with examples and usage notes. The description duplicates these details but does not significantly add to parameter semantics beyond what the schema provides, so the baseline of 3 applies.

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 uses a specific verb ('Load and parse') with a clear resource ('OpenAPI/Swagger specification document from a URL'), and the sibling context (e.g., swagger_load_local_spec) shows this tool is the URL-based loader. This clearly distinguishes it from siblings that list tags/paths or load local specs.

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

Usage Guidelines4/5

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

The description explicitly states 'You must load a spec before using any other tools,' providing a mandatory usage context. It also covers when auth_header is needed and gives examples for common requests, though it doesn't explicitly mention swagger_load_local_spec as an alternative—the URL-vs-local distinction is implied by the tool name and description.

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/anuoua/swagger-doc-explorer-mcp'

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