Skip to main content
Glama

Compare two semantic versions

compare_versions
Read-onlyIdempotent

Compare a and b by SemVer precedence (prereleases sort before the release, build metadata ignored). Returns -1, 0 or 1 and the change type from the lower to the higher version (major, minor, patch, premajor, preminor, prepatch, prerelease) exactly like semver.diff. Read-only. Same engine as GET /api/compare.

Input Schema

NameRequiredDescriptionDefault
aYesFirst version: a semantic version such as "1.4.2", "v2.0.0" or "3.0.0-rc.1+build.5".
bYesSecond version: a semantic version such as "1.4.2", "v2.0.0" or "3.0.0-rc.1+build.5".

Output Schema

NameRequiredDescriptionDefault
aNo
bNo
diffYes
notesNo
resultYes
relationYes
apiVersionYes
buildDiffersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the 'Read-only' sentence is largely redundant. What the description does add is substantive: prereleases sort before the release, build metadata is ignored, the return is -1/0/1 plus a semver.diff-style change type, and results match GET /api/compare — all behavior not derivable from the annotations.

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?

Three tight sentences, front-loaded with the precedence rule the agent most needs, followed by return shape and provenance. No filler and no restatement of the title alone.

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?

With annotations covering safety and an output schema covering the response shape, the remaining burden is semantic correctness, and the description covers precedence, metadata handling, and change-type semantics fully. Nothing needed to invoke it correctly is missing.

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 already documents 'a' and 'b' formats thoroughly. The description adds interpretation the schema lacks: both are parsed as SemVer, and the change type is computed from the lower to the higher version rather than from a to b, which resolves a real ambiguity about operand roles.

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 (compare) and resource (two semantic versions) plus the exact precedence rule applied. An agent can distinguish it from bump_version, check_range, and resolve_versions without opening the schema, since those change or validate versions rather than order two of 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?

Gives clear context for when it applies: ordering two concrete versions by SemVer precedence, with prerelease and build-metadata rules spelled out. It does not explicitly name an alternative such as check_range or parse_version or state when not to use it, so it stops short of full routing guidance.

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