Skip to main content
Glama

Validate Spec

validate_spec
Read-only

Validates OpenAPI specs against the standard and dry-runs imports or pushes, reporting errors, warnings, detected format, and what would be created without writing anything.

Instructions

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
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. Changed2 schema fields changedv2.0.1
    • 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"
      +  ]
      +}
  2. First observedv1.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true; the description goes further by confirming 'Nothing is written either way' and explaining what each dry-run returns (same errors/warnings, plus endpoint/schema/folder counts, detected format, and whether a 3.0 → 3.1 conversion occurred). It also discloses that specId validation exports the spec first, which is non-obvious side behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then mode-by-mode routing, then a closing safety statement. Every sentence carries distinct information; nothing is restated from the name or title.

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 7-parameter, no-output-schema tool this is nearly complete: dry-run outputs, exclusivity of content vs specId, and side effects are all covered. The one gap is the shape of the default 'openapi' validation result, which is only implied by 'same errors and warnings' rather than described.

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 adds real meaning on top: it explains the semantic consequences of each mode value and the required combination for 'push' (specId plus content). It does not, however, add anything about format, versionId, convertToOpenApi31, or shortenSchemaNames beyond what the schema already says.

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 specification) and immediately differentiates the three modes, including that 'import' and 'push' are dry runs of named sibling tools rather than the real thing. An agent can tell this apart from import_spec/push_spec without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit selection rules: use content to validate inline, specId to validate an existing spec, mode 'import' to preview import_spec, and mode 'push' with both specId and content to preview push_spec. The alternatives are named and the conditions that select them are spelled out.

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