Load Swagger/OpenAPI Spec
swagger_load_specLoad 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:
Use when: "Load the Petstore API spec" -> params with url="https://petstore.swagger.io/v2/swagger.json"
Use when: "Load our internal API docs" -> params with url="https://api.internal.company.com/openapi.json"
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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to the OpenAPI/Swagger JSON spec (e.g., 'https://petstore.swagger.io/v2/swagger.json') | |
| auth_header | No | Authorization header value for protected specs (e.g., 'Bearer eyJhbGci...' or 'Basic base64string'). Only needed if the spec requires authentication. |