Load Local Swagger/OpenAPI Spec File
swagger_load_local_specLoad 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
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to a local OpenAPI/Swagger JSON file (e.g., './swagger.doc.json' or '/absolute/path/to/spec.json') |