Skip to main content
Glama

check_api_contract

Read-onlyIdempotent

When: you hold an API contract and want it checked. Gives: spec → is this OpenAPI 3.x document valid (required fields, unique operationIds, undeclared $ref, missing 2xx; errors with JSON pointers); schema + value or values → does each JSON value satisfy this JSON Schema (draft-07 subset; a keyword it cannot evaluate reads INCONCLUSIVE, never valid). One gate per check, the worst on top. Deterministic, no network. Does not prove: that the running API returns what the spec says (pass a real response as value against its schema), nor anything about keywords outside the subset.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "value": {
        "id": "ord_1"
      },
      "schema": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          }
        }
      }
    },
    "name": "check_api_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
specNoOpenAPI 3.x document, JSON or YAML text, or the parsed object.
valueNoOne JSON value to check against schema (a scalar as JSON text, e.g. "0").
schemaNoJSON Schema, text or object.
valuesNoSeveral values, e.g. responses captured from the API; each checked.

Output Schema

NameRequiredDescriptionDefault
gateNo
checksNo
verdictNo
next_stepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial behavior beyond them: deterministic, no network, one gate per check with the worst result surfaced first, and unevaluable keywords returning INCONCLUSIVE rather than valid. The scope limitation to a draft-07 subset and the JSON-pointer error format are exactly the caveats an agent needs before trusting a pass result.

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-loaded 'When:'/'Gives:' structure with arrow notation packs a lot into one paragraph with no filler sentences. The telegraphic compression costs some readability ('One gate per check, the worst on top'), but nothing is redundant.

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

Completeness5/5

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

An output schema exists, so return values need no prose, yet the description still previews the verdict ordering and error pointer format. Combined with the explicit limitations section, an agent has everything needed to invoke both modes correctly and interpret the result.

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 individual parameter meaning is already handled and the baseline is 3. The description earns above baseline by explaining the parameter combinations as modes: spec alone versus schema paired with value or values, which is real invocation guidance the schema does not state, especially given zero required parameters.

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 description names the two exact operations with their inputs: 'spec → is this OpenAPI 3.x document valid' and 'schema + value or values → does each JSON value satisfy this JSON Schema'. An agent knows this is contract/schema validation, not test generation or evaluation, which distinguishes it from siblings like run_eval_contract or package_check.

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?

Starts with an explicit trigger ('When: you hold an API contract and want it checked') and then gives a negative boundary with a workaround: it 'Does not prove: that the running API returns what the spec says (pass a real response as value against its schema)'. That tells the agent both when to call it and how to route around its limits.

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.