Skip to main content
Glama

semver_compare

Compare two TypeScript library versions to detect breaking API changes and get the recommended SemVer bump.

Instructions

Compare two versions of a TypeScript library and detect breaking API changes. Either side can be a filesystem path, a git ref, or an npm spec, so a working tree can be compared against the published release without checking anything out. npm specs and git refs need network access and are unpacked into temp directories that are removed afterwards; nothing in a local path is written unless "installDeps" is set. Returns the recommended SemVer bump (major/minor/patch) and a list of changes. Each change carries a confidence: "proven" (a structurally confident break) or "heuristic" (a conservative major the tool could not prove safe), and summary.majorProven / majorReview split the major count accordingly. The "gate" field gives what each CLI gate would exit with: "strict" fails only on a proven break, "strictReview" on any major. A "strict" pass does not mean nothing broke, since a break the tool could not prove stays review-only, so report both. Pass "declared" to grade the release against the bump it writes down instead of recommending one; a major it already declares then passes both gates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newNoNew version: a filesystem path, a git ref, or an npm spec. Defaults to current directory..
oldYesOld version: a filesystem path, a git ref (tag, branch, commit SHA), or an npm spec. A "name@version" that is not an existing path is read as npm (e.g. "lodash@4.17.21", "lodash@latest"); prefix with "npm:" to say so outright.
entryNoEntry file relative to project root (e.g. "src/index.ts"). Pass an array or a comma-separated string for a package with several entry points. Auto-detected from package.json if omitted.
newAsNoForce "new" to be treated as a filesystem path, a git ref, or an npm spec. "ref" is an accepted spelling of "git".
oldAsNoForce "old" to be treated as a filesystem path, a git ref, or an npm spec. "ref" is an accepted spelling of "git". Only needed when auto-detection would read the input as the wrong kind, which is what a monorepo tag shaped like "pkg@1.2.3" needs.
declaredNoThe bump this release declares, or "auto" to read it from .changeset/*.md and then the two package.json versions. Adds a "declaration" verdict to the report: "mismatch" when a proven break outranks the declaration, "review" when the changes argue for more than was declared, "ok" otherwise. Errors when "auto" finds nothing to read, rather than reporting a pass.
maxChangesNoHow many changes to include (default 50). They are ordered proven breaks first, then additions, then review-only ones, so the cap drops the least actionable end. "summary" always counts every change, and an "omitted" field reports what was left out and the number to pass to get all of it.
installDepsNoInstall dependencies before analysis. In a local path with no node_modules this runs "npm install --ignore-scripts" in that directory, and adds @types/node there if it is missing. Only a local path needs it: a git ref is always installed in its temp copy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.15.2
    • changedInput schema / properties / installDeps / description
      Previous value: -"Install dependencies before analysis (needed for local paths without node_modules)"New value: +"Install dependencies before analysis. In a local path with no node_modules this runs \"npm install --ignore-scripts\" in that directory, and adds @types/node there if it is missing. Only a local path needs it: a git ref is always installed in its temp copy."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With zero annotations, the description carries the whole burden and does so: it discloses network access for npm specs/git refs, temp-dir unpacking that is cleaned up, that local paths are not written unless installDeps is set, and that installDeps runs "npm install --ignore-scripts" and may add @types/node. It also warns that a "strict" pass does not mean nothing broke, a genuinely important caveat.

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 is front-loaded and each sentence carries real information, but it is a single dense block that mixes invocation guidance with return-value semantics (confidence, summary.majorProven/majorReview, gate). Slightly heavier than needed for a tool description, though little is wasted.

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?

For an 8-parameter tool with no annotations and no output schema, the description supplies the missing return contract (recommended bump, change list, confidence tiers, gate exits, omission reporting) and the safety/network implications. An agent could call this correctly and interpret the result without further context.

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 schema baseline is 3; the description still adds cross-parameter meaning, e.g. declared="auto" reads .changeset/*.md then package.json versions and errors when nothing is readable, and maxChanges orders proven breaks first so the cap drops the least actionable end. These are behaviors the enum/integer constraints alone do not convey.

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?

Opens with a specific verb and resource: "Compare two versions of a TypeScript library and detect breaking API changes." An agent immediately knows the domain and operation. It does not, however, differentiate itself from the sibling semver_snapshot, which the agent must infer from name alone.

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?

Gives concrete conditions for the input forms (path vs git ref vs npm spec, with "npm:" prefix escape) and for mode choices such as oldAs when a monorepo tag looks like "pkg@1.2.3", and declared when grading against a declared bump. No explicit routing versus semver_snapshot, so it stops short of full when-not guidance.

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