Interval union

interval_union · version 1.0.0 · Numbers & math · free, no key needed

Merge overlapping or adjacent numeric intervals.

Use when you need to: interval union.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "intervals": [
    {
      "start": 1,
      "end": 3
    },
    {
      "start": 3,
      "end": 5
    }
  ]
}

Response:

{
  "result": {
    "union": [
      {
        "start": 1,
        "end": 5
      }
    ]
  }
}

How to call it

MCP

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

{
  "id": "interval_union",
  "version": "1.0.0",
  "input": {
    "intervals": [
      {
        "start": 1,
        "end": 3
      },
      {
        "start": 3,
        "end": 5
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/interval_union/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"intervals":[{"start":1,"end":3},{"start":3,"end":5}]}'

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

CLI

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

Get the client at /clients/cli/.