Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

Swagger: Validate API

swagger_validate_api
Read-onlyIdempotent

Validate OpenAPI or AsyncAPI definitions to find structural errors, with structured diagnostics by line, severity, and message from server-side linting.

Instructions

Validate an OpenAPI or AsyncAPI definition using server-side apidom-ls. Returns structured diagnostics with line number, severity, and message for each finding. Supports OpenAPI 2.0, 3.0, 3.1, and AsyncAPI. Provide either the raw definition (JSON or YAML) OR an existing API by owner, apiName, and version. Use this tool when the user asks to validate, lint, or check an API spec for structural errors matching the Studio Validation tab.

Toolset: Registry API

Parameters:

  • definition (string): API definition content (OpenAPI/AsyncAPI in JSON or YAML). Provide this or owner/apiName/version, not both.

  • owner (string): API owner (organization or user). Use with apiName and version to fetch an existing API from the registry.

  • apiName (string): API name

  • version (string): Version identifier

  • maxProblems (number): Cap on the number of findings returned (default 100, max 1000)

  • uri (string): Optional pseudo-URI hint for the parser (e.g. inmemory://spec.yaml)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoOptional pseudo-URI hint for the parser (e.g. inmemory://spec.yaml)
ownerNoAPI owner (organization or user). Use with apiName and version to fetch an existing API from the registry.
apiNameNoAPI name
versionNoVersion identifier
definitionNoAPI definition content (OpenAPI/AsyncAPI in JSON or YAML). Provide this or owner/apiName/version, not both.
maxProblemsNoCap on the number of findings returned (default 100, max 1000)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
specNoDetected specification info
validNoTrue if the spec has no error findings
summaryNo
findingsNoList of validation findings
recognizedNoTrue if the spec was recognized as OpenAPI/AsyncAPI

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.41.3

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive. The description adds genuinely useful behavior: server-side execution, structured diagnostics with line number/severity/message per finding, and a default cap of 100 findings (max 1000). It does not state what an empty result means or how severity levels are enumerated, keeping it below 5.

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?

Front-loads the action and return shape, then the input modes, then the trigger condition. Sentences carry information, though the param recap paragraph duplicates schema text and could be trimmed.

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

Completeness4/5

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

For a read-only validation tool with a full schema, annotations, and an output schema, the description covers capability, input modes, supported formats, and output shape. Only minor gaps remain (severity taxonomy, meaning of a clean result), which the output schema likely resolves.

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?

Schema coverage is 100%, so the baseline is 3. The description adds real meaning beyond the schema: it explains that definition and owner/apiName/version are alternatives ('Provide either ... OR ...'), clarifies the registry-fetch semantics of the owner triple, and gives a concrete example for the otherwise cryptic uri hint.

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?

States a specific verb and resource ('Validate an OpenAPI or AsyncAPI definition'), names the underlying engine (apidom-ls), and enumerates supported spec versions (2.0, 3.0, 3.1, AsyncAPI). This is clearly distinguishable from siblings like swagger_scan_api_standardization or swagger_get_api_definition.

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?

Gives an explicit trigger: 'Use this tool when the user asks to validate, lint, or check an API spec for structural errors matching the Studio Validation tab.' It also documents the two mutually exclusive input modes. It stops short of naming a sibling alternative for the adjacent standardization/scanning use cases, so it is clear but not fully routing.

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

Deploy Server

Other Tools