Skip to main content
Glama

Check a version against an npm range

check_range
Read-onlyIdempotent

Does a version satisfy an npm-style range (^, ~, x-ranges, hyphen ranges, comparators, || alternatives)? Returns the answer and the range desugared into plain comparators (e.g. ^0.2.3 → >=0.2.3 <0.3.0-0), with a note when npm's prerelease rule is why it fails. Read-only. Same engine as GET /api/satisfies.

Input Schema

NameRequiredDescriptionDefault
rangeYesnpm-style range, e.g. "^1.2.0", "~1.4", ">=1.0.0 <2.0.0", "1.2.3 - 2.x", "1.x || >=3.0.0-beta.1".
versionYesVersion to test: a semantic version such as "1.4.2", "v2.0.0" or "3.0.0-rc.1+build.5".
includePrereleaseNoLet prereleases match any range they fall inside (npm includePrerelease). Default false (npm behaviour).

Output Schema

NameRequiredDescriptionDefault
notesNo
rangeNo
versionNo
satisfiesYes
apiVersionYes
normalizedYes
includePrereleaseNo

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 establish read-only, idempotent, non-destructive, closed-world, so the bar is lower. The description adds genuinely new behavior: it returns both the boolean answer and the range desugared into plain comparators, and it flags when npm's prerelease rule caused a failure. 'Same engine as GET /api/satisfies' also gives API-parity context.

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, each earning its place: capability first, then return shape with a concrete desugaring example, then the read-only/parity footnote. Front-loaded and free of filler.

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?

A simple read-only predicate with a rich annotated profile, 100%-covered input schema and an output schema, so the description needn't spell out return values. What it does add — desugaring output and prerelease-failure notes — covers the remaining ambiguity about why a check might fail unexpectedly.

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% and each parameter already carries examples and a default, so the baseline is 3. The description only indirectly illuminates includePrerelease by mentioning npm's prerelease rule; it names no parameter and adds no syntax beyond the schema.

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 and resource: 'Does a version satisfy an npm-style range', and enumerates the range grammar it understands (^, ~, x-ranges, hyphen, comparators, ||). This is clearly distinct from compare_versions (ordering) and parse_version (parsing) among the siblings.

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 question form implies the use case — testing membership in a range — but the description never says when to prefer it over compare_versions or resolve_versions, and lists no exclusions or prerequisites. Usage must be inferred from the phrasing rather than stated.

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