Semantic versions: parse, compare, sort, and check against npm-style ranges
semverSemantic 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).
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": {
"versions": "<versions>"
},
"name": "semver"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | Optional npm-style range, e.g. ^1.2.0 || >=2.1 <3 | |
| versions | Yes | One or more versions, comma separated | |
| compareTo | No |