Skip to main content
Glama

Compare versions / check a semver range

semver_compare
Read-onlyIdempotent

Compare two semantic versions (incl. prerelease ordering) or test whether a version satisfies an npm-style range (^, ~, x, comparators, ||).

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": {
      "a": "<a>"
    },
    "name": "semver_compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesVersion, e.g. 1.4.2
bNoVersion to compare with
rangeNoRange to test a against, e.g. ^1.2.0 || >=2.0.0 <3

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and openWorldHint=false, so safety is covered. The description adds genuine behavioral context by noting prerelease ordering rules and the exact npm range grammar (^, ~, x, comparators, ||). However, with no output schema, it never says what shape the result takes (numeric -1/0/1 versus a boolean for range testing), which is the main behavioral unknown.

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?

A single dense sentence with the primary mode first and the alternative second; every clause (prerelease ordering, range operators) carries information an agent needs. No filler, no restatement of the tool name.

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?

For a small three-parameter utility the description covers inputs and semantics well, and annotations cover safety. But with no output schema, the description owes the agent a statement about the return value in each mode, and about the fact that b and range are mutually exclusive — both gaps matter for correct invocation.

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 100%, so all three parameters are already documented with examples, establishing the baseline of 3. The description only echoes the schema's semantics (a is the subject, range is tested against a) and adds no format rules, precedence, or conflict handling beyond what is already structured.

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?

Names a concrete verb (compare / test) and resource (semantic versions, semver ranges) and spells out both operating modes in one sentence. The siblings are unrelated converters/generators, so no disambiguation is needed and an agent can immediately tell this is the version-comparison tool.

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?

The 'or' construction clearly frames the two use cases: pairwise comparison via b, and range membership via range. What it does not state is what happens when neither b nor range is supplied (only a is required) or when both are supplied, so the selection boundary between modes is left partly to inference.

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