Skip to main content
Glama

validate_example

Validate a JSON example against an OpenAPI operation's resolved request or response schema; violations are reported with JSON pointers to pinpoint mismatches.

Instructions

Check a JSON document against the resolved schema of an operation. kind is 'request' (validates against the request body) or 'response' (against the response for status, default 200; falls back to 2XX then default). json is the document as JSON text. Violations are reported with a JSON pointer into the document. Optionally pick a content_type; otherwise application/json (or the first JSON type) is used.

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>",
      "path": "<path>",
      "method": "<method>",
      "kind": "<kind>",
      "json": "<json>"
    },
    "name": "validate_example"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYes
kindYes
pathYes
specYes
methodYes
statusNo200
content_typeNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations present, the description carries the full behavioral burden and does substantial work: it discloses the response-status fallback chain (status -> 2XX -> default), the content-type resolution order, and that violations are reported as JSON pointers into the document. It omits how the spec/path/method are resolved (file path vs. URL vs. spec name) and what a passing result looks like, though an output schema exists.

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?

Compact and front-loaded: the core action comes first, followed by per-parameter clarifications with zero filler sentences. Every clause adds either a mode, a default, or a fallback rule.

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

Completeness3/5

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

The output schema removes the need to describe return values, and the description covers validation semantics well. For a seven-parameter tool with 0% schema coverage, though, the unexplained `spec`, `path`, and `method` inputs leave a meaningful gap an agent must guess at.

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 0%, so the description must compensate, and it does for four of seven parameters (`kind`, `json`, `status`, `content_type`). The three identity parameters `spec`, `path`, and `method` are never explained, leaving the most important inputs undocumented in both the schema and the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Check a JSON document against the resolved schema of an operation.' That is clearly distinct from linting a spec or describing an operation, though it never names a sibling to route against explicitly.

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

Usage Guidelines3/5

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

Usage is implied through the `kind` modes ('request' vs 'response') and the `status`/`content_type` defaults, which tell an agent how to configure a call. However, there is no explicit when-to-use guidance, no exclusions, and no comparison to siblings like lint_spec or describe_operation.

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