Skip to main content
Glama

x402 Toolbox

Semantic versions: parse, compare, sort, and check against npm-style ranges

semver
Read-onlyIdempotent

Semantic versions: parse, compare, sort, and check against npm-style ranges. Parses SemVer 2.0 versions; compares two (a vs b); sorts a list (invalid ones reported); checks versions against npm range syntax (^, ~, x-ranges, hyphen ranges, comparators, ||) with correct prerelease rules; returns the highest version satisfying the range. Price: $0.003 USDC per call via x402 (eip155:8453).

Input Schema

NameRequiredDescriptionDefault
rangeNoOptional npm-style range, e.g. ^1.2.0 || >=2.1 <3
versionsYesOne or more versions, comma separated
compareToNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description still adds real behavior the annotations cannot: invalid versions are reported rather than silently dropped, prerelease rules are handled correctly, the range check returns the single highest satisfying version, and it discloses a per-call price ($0.003 USDC via x402 on eip155:8453) — a material cost signal for an agent.

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 with the resource and its operations, then capabilities, then pricing — good ordering with no filler. It is one dense semicolon-chained block, though, and the price/x402 clause could be separated for scanability.

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?

With no output schema, the description carries the return-value burden and does so partially: it states the range check returns the highest satisfying version and that invalid entries are reported. It does not describe the shape of parse output or compare results, and never explicitly names `compareTo` as the field that triggers comparison mode, leaving a small gap for a multi-mode tool.

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 67%; `range` and `versions` are documented in-schema, but `compareTo` has no schema description at all, and the description partially compensates by explaining the two-value comparison mode. It also adds meaning beyond the schema example by enumerating supported range operators (^, ~, x-ranges, hyphen ranges, comparators, ||), which is more than the schema's single example conveys.

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 the specific resource (SemVer 2.0 versions) and enumerates the four distinct operations it performs: parse, compare, sort, and range-check. No sibling tool overlaps with semantic versioning, so an agent can route unambiguously from the name plus this sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The clause structure ('compares two (a vs b)', 'sorts a list', 'checks versions against npm range syntax') implicitly maps operations to input shapes, which helps an agent pick a mode. But there is no explicit when-to-use/when-not guidance, no statement of what happens if `range` and `compareTo` are both supplied, and no alternative tools are named.

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.