Skip to main content
Glama

TestingAPIs API tools

Validate an OpenAPI spec

validate_openapi
Read-onlyIdempotent

Check an OpenAPI 3.0/3.1 or Swagger 2.0 document (JSON or YAML) for the mistakes that break tools: missing required fields, undeclared path parameters, invalid status codes, duplicate operationIds, broken $refs, undefined security schemes and examples that don't match their schema. Returns each problem with a JSON pointer and, for JSON, a line number.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "spec": "<spec>"
    },
    "name": "validate_openapi"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYesThe whole OpenAPI or Swagger document, as JSON or YAML text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, non-open-world behavior, so the safety profile is covered. The description adds real value beyond that: it reports all problems rather than failing at the first, and describes the return shape (JSON pointer, plus line number for JSON). It leaves unstated what a clean spec returns and whether results are severity-ranked.

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?

Two sentences, no filler: the scope and supported versions come first, the concrete failure classes next, and the return format last. Every clause carries information an agent would otherwise have to guess.

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 single-parameter, annotation-rich tool with no output schema, the description covers scope, checks, and result format well enough to call correctly. Minor gaps remain around the success case (empty result vs. status flag) and any severity or truncation behavior.

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?

A single parameter with 100% schema description coverage, so the schema already documents it. The description corroborates that the whole document is passed as text in JSON or YAML, but adds no further syntax or size guidance beyond the schema's maxLength.

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 (check/validate) and a precisely scoped resource: OpenAPI 3.0/3.1 or Swagger 2.0 documents in JSON or YAML. It also enumerates the actual defect classes checked, so an agent knows this is a spec-linter rather than a generic JSON validator.

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 version and format scoping implicitly tells the agent when this is the right tool (API description documents). There is no explicit exclusion or routing statement naming validate_json_schema for plain-schema validation, which is the one plausible confusion point.

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