Rational add

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

Add two rational numbers given as numerator/denominator integer strings and return the reduced sum.

Use when you need to: rational add · add two rational numbers · add fractions as rationals.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "a": {
    "numerator": "1",
    "denominator": "2"
  },
  "b": {
    "numerator": "1",
    "denominator": "3"
  }
}

Response:

{
  "result": {
    "numerator": "5",
    "denominator": "6"
  }
}

How to call it

MCP

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

{
  "id": "rational-add",
  "version": "1.0.0",
  "input": {
    "a": {
      "numerator": "1",
      "denominator": "2"
    },
    "b": {
      "numerator": "1",
      "denominator": "3"
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/rational-add/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"a":{"numerator":"1","denominator":"2"},"b":{"numerator":"1","denominator":"3"}}'

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

CLI

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

Get the client at /clients/cli/.