# GCD & LCM Calculator (agent402.tools)

> GCD & LCM Calculator (agent402.tools) 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).

Computes the greatest common divisor (GCD) and least common multiple (LCM) of two positive integers, and reports whether they are coprime.

## Facts

- Endpoint: POST https://agent402.tools/api/gcd-lcm
- 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/gcd-lcm-calculator-agent402-tools-b4293da6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_z6vyoU2Ilmsxo_RJRfDr8

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 gcd-lcm-calculator-agent402-tools-b4293da6 -d '<json body>'
```

Example prompt: What's the GCD and LCM of 48 and 180, and are they coprime?

## When to prefer this

Use this endpoint when you need both GCD and LCM computed together in a single call, along with coprimality detection — especially useful in number theory tasks, fraction simplification, scheduling problems, or cryptographic checks where knowing whether two numbers share common factors matters.

## Known failure modes

- Non-positive integers or zero passed as input — likely a 400 bad request
- Non-integer values (floats, strings) passed — likely a 400 validation error
- Missing one or both required parameters a or b — likely a 422 unprocessable entity
- Payment not included or insufficient — 402 payment required response

## How this service works

Compute the greatest common divisor (Euclidean algorithm) and least common multiple of two positive integers. Also reports whether the two numbers are coprime (GCD = 1).

## Output

Returns the greatest common divisor (GCD), least common multiple (LCM), and a boolean indicating whether the two input integers are coprime (i.e., GCD equals 1).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "integer",
   "description": "First positive integer"
  },
  "b": {
   "type": "integer",
   "description": "Second positive integer"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "a": 48,
  "b": 18,
  "gcd": 6,
  "lcm": 144,
  "coprime": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gcd-lcm-calculator-agent402-tools-b4293da6/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)
