Skip to main content
Glama
anuoua

swagger-doc-explorer-mcp

by anuoua

Load Local Swagger/OpenAPI Spec File

swagger_load_local_spec
Read-only

Load and parse a local OpenAPI/Swagger JSON file to make its endpoints and schemas available for exploration.

Instructions

Load and parse an OpenAPI (Swagger) specification document from a local JSON file.

This tool reads a JSON OpenAPI/Swagger spec from a local file path and stores it in memory for subsequent exploration. The file path can be absolute or relative to the current working directory.

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:

  • file_path (string): Path to a local OpenAPI/Swagger JSON file (e.g., "./swagger.doc.json" or "/path/to/api-spec.json")

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:

  • Use when: "Load the local swagger.doc.json" -> params with file_path="./swagger.doc.json"

  • Use when: "Load our API spec from disk" -> params with file_path="/home/user/projects/api/openapi.json"

Error Handling:

  • Returns error if the file path does not exist

  • Returns error if the file is not valid JSON

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to a local OpenAPI/Swagger JSON file (e.g., './swagger.doc.json' or '/absolute/path/to/spec.json')
Behavior5/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false, but the description adds valuable behavioral detail: it stores the spec in memory, assigns a unique name with numeric suffix for duplicates, and lists exact error conditions. This goes beyond the structured annotations and gives the agent a clear model of side effects and edge cases.

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-organized with a clear first sentence, then sections for Args, Returns, Examples, and Error Handling. Every sentence adds necessary information, and there is no filler or redundancy. It is appropriately detailed for a tool that lacks an output schema.

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?

With only one parameter and no output schema, the description fully compensates by detailing the return object's fields with descriptions, explaining naming behavior, and enumerating error scenarios. This makes the tool's behavior fully predictable and self-contained for an agent.

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

Parameters4/5

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

The schema already describes file_path with 100% coverage, so the baseline is 3. The description enhances this by providing example path formats ('./swagger.doc.json' vs '/absolute/path/to/spec.json') and explaining that paths can be relative or absolute, giving the agent practical guidance beyond the schema.

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 begins with 'Load and parse an OpenAPI (Swagger) specification document from a local JSON file,' which uses a specific verb and resource. It clearly distinguishes from sibling tools by emphasizing 'local JSON file' and contrasting with the broader swagger_load_spec context.

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 provides clear use-case examples ('Use when: Load the local swagger.doc.json') and states that the path can be absolute or relative, which clarifies when to invoke this tool. However, it does not explicitly mention when not to use it or directly reference alternative tools like swagger_load_spec for remote URLs.

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