Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

Swagger: Get API Definition

swagger_get_api_definition
Read-onlyIdempotent

Retrieve a resolved API definition from SwaggerHub Registry by providing owner, API name, and version. Choose JSON or YAML output, with options to include external refs or flatten inline schemas.

Instructions

Fetch resolved API definition from SwaggerHub Registry based on owner, API name, and version. By default returns the definition as JSON (converting YAML-stored definitions to JSON). Set format:'text' to get the YAML definition — required as the source for swagger_patch_api edits.

Toolset: Registry API

Parameters:

  • owner (string) required: API owner (organization or user, case-sensitive)

  • api (string) required: API name (case-sensitive)

  • version (string) required: Version identifier

  • resolved (boolean): Set to true to get the resolved version with all external $refs included (default false)

  • flatten (boolean): Set to true to create models from inline schemas in OpenAPI definition (default false)

  • format (enum): Response format: 'json' (default) may convert YAML to JSON; 'text' returns the definition as YAML — required for swagger_patch_api edits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesAPI name (case-sensitive)
ownerYesAPI owner (organization or user, case-sensitive)
formatNoResponse format: 'json' (default) may convert YAML to JSON; 'text' returns the definition as YAML — required for swagger_patch_api edits.
flattenNoSet to true to create models from inline schemas in OpenAPI definition (default false)
versionYesVersion identifier
resolvedNoSet to true to get the resolved version with all external $refs included (default false)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
definitionYes
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

The description adds useful behavior beyond the annotations: it discloses YAML-to-JSON conversion by default, explains the resolved and flatten options, and specifies that format:'text' returns YAML for patching. These details complement the readOnlyHint and idempotentHint annotations and do not contradict them.

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?

The description is well-structured and front-loaded with the purpose and key caveats before the parameter list. It is reasonably concise, but the parameter bullet list duplicates the input schema, which keeps it from being maximally economical.

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?

For a read-only lookup with a fully documented schema and an available output schema, the description covers the core selection criteria, default format behavior, optional transformation flags, and the patch-workflow use case. Nothing essential for invoking the tool correctly is missing.

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 parameter list in the description largely repeats the input schema verbatim. It adds no substantially new meaning beyond the schema, so the baseline score of 3 is appropriate.

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 first sentence states a clear verb and resource: 'Fetch resolved API definition from SwaggerHub Registry based on owner, API name, and version.' This identifies the exact lookup operation and differentiates it from sibling tools like swagger_patch_api and swagger_search_apis_and_domains, even without naming them.

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 gives clear operational context: default JSON conversion behavior is explained, and format:'text' is explicitly described as required for swagger_patch_api edits. It does not explicitly mention alternatives for searching or listing definitions, but the usage context is strong and actionable.

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

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/SmartBear/smartbear-mcp'

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