# agent402.tools Semantic Version Parser & Comparator

> agent402.tools Semantic Version Parser & Comparator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Parses a semantic version string into its components, or compares two semver strings returning -1, 0, or 1 with greater/lesser flags.

## Facts

- Endpoint: POST https://agent402.tools/api/semver
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-semantic-version-parser-comparator-346b9fa1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_llTd1iZC25haGIb18YVy7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-semantic-version-parser-comparator-346b9fa1 -d '<json body>'
```

Example prompt: Can you compare these two version strings for me — is 2.4.1 greater than, equal to, or less than 2.10.0?

## When to prefer this

Use this endpoint when you need to programmatically parse a semantic version string into structured components or compare two semver strings according to semver spec ordering rules — particularly useful in CI/CD pipelines, package managers, update checkers, or any workflow needing version ordering logic.

## Known failure modes

- Malformed version string (e.g. 'abc' or '1.x.y') may return a parse error
- Missing required field 'a' returns a validation error
- Non-semver format strings may fail to parse correctly
- Network or payment authorization failure returns HTTP 402 or 5xx

## How this service works

Parse a semantic version, or compare two (a vs b → -1/0/1, with greater/lesser flags).

## Output

Returns parsed components of the version string (major, minor, patch, pre-release, etc.) and, when two versions are provided, a comparison integer (-1, 0, or 1) along with boolean greater/lesser flags indicating the ordering relationship between version a and version b.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "Version to parse (or left side of compare)"
  },
  "b": {
   "type": "string",
   "description": "Optional right side of compare"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "a": {
   "major": 2,
   "minor": 4,
   "patch": 0
  },
  "equal": false,
  "aGreater": false,
  "comparison": -1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-semantic-version-parser-comparator-346b9fa1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
