Rational trace check

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

Check a step-by-step rational calculation trace; reports the first step whose operand, operator or result disagrees.

Use when you need to: verify a step by step fraction calculation · check a calculation trace with fractions · find the first wrong step in my arithmetic.

Decide before calling

Read the versioned contract and the supported scope below. Reuse rational-trace-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-trace-check@1.0.0 for verify a step by step fraction calculation. 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:

{
  "inputs": {},
  "steps": [
    {
      "id": "s1",
      "operator": "+",
      "left": {
        "value": "1",
        "from": null
      },
      "right": {
        "value": "1/2",
        "from": null
      },
      "result": "3/2"
    },
    {
      "id": "s2",
      "operator": "+",
      "left": {
        "value": "3/2",
        "from": "s1"
      },
      "right": {
        "value": "1/3",
        "from": null
      },
      "result": "11/6"
    }
  ],
  "claimed_result": "11/6",
  "require_canonical": true
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "steps_checked": 2,
    "final_value": "11/6",
    "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-trace-check",
  "version": "1.0.0",
  "input": {
    "inputs": {},
    "steps": [
      {
        "id": "s1",
        "operator": "+",
        "left": {
          "value": "1",
          "from": null
        },
        "right": {
          "value": "1/2",
          "from": null
        },
        "result": "3/2"
      },
      {
        "id": "s2",
        "operator": "+",
        "left": {
          "value": "3/2",
          "from": "s1"
        },
        "right": {
          "value": "1/3",
          "from": null
        },
        "result": "11/6"
      }
    ],
    "claimed_result": "11/6",
    "require_canonical": true
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/rational-trace-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"inputs":{},"steps":[{"id":"s1","operator":"+","left":{"value":"1","from":null},"right":{"value":"1/2","from":null},"result":"3/2"},{"id":"s2","operator":"+","left":{"value":"3/2","from":"s1"},"right":{"value":"1/3","from":null},"result":"11/6"}],"claimed_result":"11/6","require_canonical":true}'

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

CLI

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

Get the client at /clients/cli/.