Skip to main content
Glama

Validate Spec

validate_spec
Read-only

Validate an OpenAPI specification against the standard. Provide either content to validate directly, or specId to validate an existing spec. Set mode to 'import' for a dry run of import_spec instead: same errors and warnings, plus what would be created (endpoint, schema and folder counts), the detected format and whether a 3.0 → 3.1 conversion happened. Mode 'push' with specId and content is the dry run of push_spec. Nothing is written either way.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "validate_spec"
  }
}

Input Schema

NameRequiredDescriptionDefault
lineNoFor mode 'push': major version line instead of versionId
modeNoWhat to check: 'openapi' (default), 'import' or 'push'openapi
formatNoFormat hint: 'yaml', 'json', or omit for auto-detection
specIdNoPublic ID (GUID) of an existing spec to validate. If provided, the spec is exported first and then validated.
contentNoThe OpenAPI specification content to validate (YAML or JSON). Provide either content or specId, not both.
versionIdNoFor mode 'push': draft version (UUID), omit for the single draft
convertToOpenApi31NoFor mode 'import': convert a 3.0 document to 3.1 (default false)
shortenSchemaNamesNoFor mode 'import': shorten generated schema names (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / line
      Added value: +{
      +  "default": null,
      +  "description": "For mode 'push': major version line instead of versionId",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / mode / description
      Previous value: -"What to check: 'openapi' (default) or 'import'"New value: +"What to check: 'openapi' (default), 'import' or 'push'"
    • addedInput schema / properties / versionId
      Added value: +{
      +  "default": null,
      +  "description": "For mode 'push': draft version (UUID), omit for the single draft",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, but the description goes further with 'Nothing is written either way', confirming both import and push modes are side-effect-free dry runs. It also discloses what import mode returns beyond errors and warnings: creation counts, detected format, and whether a 3.0 → 3.1 conversion occurred, which is exactly the behavioral detail an agent needs before calling.

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 core action and input choice come first, followed by mode-specific behavior, so it is well front-loaded with no filler. The middle sentence is long and packs several returned fields into one clause, which is efficient but slightly dense to parse.

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?

With 8 optional parameters, no output schema, and multiple modes, the description supplies enough to pick a mode and its required inputs, and it previews the import-mode return content in place of an output schema. It is lighter on what the default 'openapi' mode returns beyond errors and warnings, a small remaining gap.

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, and the description earns an increment by explaining mode-conditional requirements the schema leaves implicit — notably that 'push' requires both specId and content together. It also frames specId as an export-then-validate path, adding operational meaning beyond the field's own text.

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 two sentences give a specific verb and resource ('Validate an OpenAPI specification against the standard') and immediately clarify the two input paths (content vs specId). The remaining sentences distinguish the 'import' and 'push' modes by naming the sibling tools they dry-run (import_spec, push_spec), so an agent can place the tool precisely.

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 states explicit selection conditions: use content to validate directly, specId to validate an existing spec, mode='import' for a dry run of import_spec, and mode='push' with both specId and content for a dry run of push_spec. It stops short of stating when not to use the tool or when a plain lint would suffice, so it is clear context without exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources