Skip to main content
Glama

Sort versions and resolve a range

resolve_versions
Read-onlyIdempotent

Sort 1 to 200 versions by SemVer precedence (duplicates removed, invalid ones listed separately) and, if a range is given, return the matching versions plus maxSatisfying / minSatisfying (what npm would install from that list) and the latest stable version. Read-only. Same engine as GET /api/resolve.

Input Schema

NameRequiredDescriptionDefault
rangeNonpm-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".
versionsYes1 to 200 versions.
includePrereleaseNoLet prereleases match any range they fall inside (npm includePrerelease). Default false (npm behaviour).

Output Schema

NameRequiredDescriptionDefault
countNo
rangeNo
sortedYes
invalidNo
matchingYes
apiVersionYes
normalizedNo
latestStableNo
maxSatisfyingYes
minSatisfyingNo
duplicatesRemovedNo
includePrereleaseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behavior: duplicates are removed, invalid versions are listed separately, range matching returns maxSatisfying/minSatisfying, and the latest stable version is included. It also confirms read-only behavior consistently with readOnlyHint=true.

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?

The description is front-loaded with the core operation and remains compact. The second sentence about read-only behavior and the shared engine is short and useful, with no wasted wording.

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?

Given the annotations, 100% schema coverage, and the presence of an output schema, the description covers the key behavior an agent needs: sorting, deduplication, invalid handling, optional range resolution, and max/min/latest stable results. Nothing critical is missing 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 the schema already documents versions, range, and includePrerelease in detail. The description adds some context around the 1–200 version limit and optional range, but does not add meaningfully beyond the schema, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: sort 1–200 versions by SemVer precedence and optionally resolve a range, returning matches plus max/minSatisfying. It is clear enough to separate it from parse_version or compare_versions, but it does not explicitly name or differentiate against the sibling tools.

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 description implies usage through the conditional 'if a range is given' and explains what happens in each case. However, it does not state when to choose this tool over check_range or compare_versions, nor does it give explicit exclusions.

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