Skip to main content
Glama

diff_specs

Compare two versions of an OpenAPI or Swagger spec and classify every change as breaking, potentially breaking, non-breaking, or informational, with reasons and exact locations.

Instructions

Compare two versions of an API and classify every change as BREAKING, POTENTIALLY_BREAKING (needs a human look), NON_BREAKING or INFO, with the reason and exact location (operation, schema path, JSON pointer, line).

Rules follow request/response variance: in a request, tightening is breaking (new required parameter or property, narrower type, removed enum value, stricter min/max/pattern); in a response, loosening or removing guarantees is breaking (property removed or made optional, type changed, nullable added, success code removed). Also checks auth changes, content types, parameter style/location, oneOf/anyOf/allOf and discriminator. Equivalent specs written differently (reordered keys, $ref vs inline, nullable vs type [x,'null'], Swagger 2.0 vs OpenAPI 3) report no changes.

old and new are paths inside the allowed directory, or spec text.

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": {
      "old": "<old>",
      "new": "<new>"
    },
    "name": "diff_specs"
  }
}

Input Schema

NameRequiredDescriptionDefault
newYes
oldYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses the classification scheme, the asymmetry rule (tightening breaks requests, loosening breaks responses), the specific surfaces checked (auth, content types, parameter style/location, oneOf/anyOf/allOf, discriminator), and the normalization rules that suppress noise. It omits error behavior for missing/invalid files and any size or performance limits.

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?

Purpose and classification come first, followed by the rule set, with the input format note at the end. The middle rules paragraph is dense and long, but each clause documents a real detection behavior rather than padding.

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 diff engine with an existing output schema, the description supplies everything needed to interpret results and call it correctly: input forms, classification semantics, and equivalence normalization. Only edge-case behavior (malformed specs, unreadable paths, very large files) is left unaddressed.

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 description coverage is 0%, so the description must compensate, and it does by explaining that 'old' and 'new' are paths inside the allowed directory or spec text — crucial information the bare string schema lacks. It does not specify path formats, whether directories or only single files are accepted, or how inline text is delimited.

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 opens with a specific verb and resource ('Compare two versions of an API') and immediately defines the output taxonomy (BREAKING, POTENTIALLY_BREAKING, NON_BREAKING, INFO) with reason and location. That makes it clearly distinct from siblings like lint_spec, validate_example, or changelog_markdown without needing to name them.

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?

It gives strong context for when this tool's output is meaningful (breaking-change detection under request/response variance semantics) and states the important exclusion that semantically equivalent specs report no changes, which prevents false expectations. It stops short of explicitly routing the agent away from lint_spec or changelog_markdown when those would be the right choice.

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