Rational expression check

rational-expression-check · version 1.0.0 · Numbers & math · free, no key needed

Check a claimed exact rational value of an integer/fraction expression; reports the true value and the difference.

Use when you need to: verify a claimed fraction result · check exact value of a fraction expression · is this rational arithmetic answer correct.

Decide before calling

Read the versioned contract and the supported scope below. Reuse rational-expression-check@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use rational-expression-check@1.0.0 for verify a claimed fraction result. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "expression": "1 + 1/2 + 1/3 + 1/4",
  "claimed_value": "25/12",
  "require_canonical": true
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "value": "25/12",
    "first_discrepancy": null,
    "reference_version": "ISO/IEC 10967-2:2001 (LIA-2) exact-result terminology; exact arithmetic over the rationals with canonical reduced form; RFC 8259 sec. 6 integer grammar and sec. 7 strings"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "rational-expression-check",
  "version": "1.0.0",
  "input": {
    "expression": "1 + 1/2 + 1/3 + 1/4",
    "claimed_value": "25/12",
    "require_canonical": true
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/rational-expression-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"expression":"1 + 1/2 + 1/3 + 1/4","claimed_value":"25/12","require_canonical":true}'

The machine-readable contract is at /v1/tools/rational-expression-check/versions/1.0.0.

CLI

node cli.mjs run rational-expression-check 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.