Skip to main content
Glama

Check if a version satisfies an npm range

check_semver_range
Read-onlyIdempotent

Evaluate whether a version satisfies an npm SemVer range with node-semver in strict mode, explaining prerelease handling. When to use: Use when a package.json range (^, ~, ||, hyphen ranges) and a concrete version disagree or prereleases are involved. Notes: No account or token needed. A match does not establish runtime compatibility. Example arguments: {"range":"^1.2.3 || >=2.0.0-beta.1 <2.1.0","version":"2.0.0-beta.3"}

Input Schema

NameRequiredDescriptionDefault
rangeYesnpm range expression.
versionYesExact version to test.
includePrereleaseNoLet prereleases match ordinary comparators (default false, like npm).

Output Schema

NameRequiredDescriptionDefault
errorNo
matchYes
scopeYes
sourceYes
prereleaseYes
explanationYes
defaultMatchYes
normalizedRangeYes
includePrereleaseYes
normalizedVersionYes
matchIncludingPrereleaseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / includePrerelease / description
      Added value: +"Let prereleases match ordinary comparators (default false, like npm)."
    • addedInput schema / properties / range / description
      Added value: +"npm range expression."
    • addedInput schema / properties / version / description
      Added value: +"Exact version to test."
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive/closed-world, and the description still adds real context: strict node-semver mode, prerelease handling, no account or token required, and the caveat that a match does not establish runtime compatibility. That last limitation is the kind of behavioral disclosure annotations cannot provide, though return shape and edge-case failures are left to the output schema.

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?

Purpose is front-loaded in the first sentence, followed by tightly labeled When-to-use, Notes, and an example. Every sentence carries distinct information with no restatement of the name or schema.

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 an output schema present, return values need no explanation, and the description covers the remaining needs: strict-mode semantics, prerelease behavior, auth requirements, and the limits of a match result. Nothing required to call 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 baseline is 3, but the description goes beyond it by naming the range grammar forms (^, ~, ||, hyphen ranges) and illustrating prerelease interaction with a concrete example argument. It meaningfully enriches how the range string should be interpreted rather than restating 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 (evaluate) and resource (version against an npm SemVer range), plus the exact engine and strict-mode semantics. An agent can distinguish this from validate_package_json or check_dependencies without reading the schema.

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 'When to use' line names the triggering conditions clearly: ranges disagreeing with a concrete version, or prereleases being involved. It gives no explicit when-not-to-use or named alternative sibling, so it stops short of a 5.

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