Tools for agents: Exact interval-set algebra
Normalize and combine half-open rational ranges with exact unions, intersections, differences and lengths.
Connect with MCP
{
"mcpServers": {
"super-agent-tools": {
"url": "https://app.getsupers.com/sites/agent-interval-sets/mcp"
}
}
}Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.
Call interval_set_algebra
Each interval is [start,end): start included, end excluded. Endpoints must be finite integers or quoted decimal/fraction strings; JSON floats and booleans are rejected. Reversed ranges fail; equal endpoints are empty and discarded. Unsorted, duplicate, overlapping and touching input ranges are accepted and normalized into sorted disjoint ranges. Touching ranges merge because their union has no gap; touching ranges have empty intersection. Both directed differences are returned. Empty sets are allowed. Results and total covered lengths are exact rational strings, not rounded decimals. This is continuous one-dimensional set algebra: lengths are not counts of integer points. No infinite endpoints, timestamps, time zones, units, closed-right boundaries or source provenance are inferred. All inputs must use the same coordinate system and unit.
Input and output schemas
{
"name": "interval_set_algebra",
"title": "Exact interval-set algebra",
"description": "Normalize two sets of half-open rational intervals and return union, intersection and both directed differences with exact total lengths.",
"inputSchema": {
"properties": {
"left": {
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
"title": "Left",
"type": "array"
},
"right": {
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
"title": "Right",
"type": "array"
}
},
"required": [
"left",
"right"
],
"title": "interval_set_algebraArguments",
"type": "object"
},
"outputSchema": {
"additionalProperties": true,
"title": "interval_set_algebraDictOutput",
"type": "object"
},
"icons": null,
"annotations": {
"title": null,
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": false
},
"meta": null,
"execution": null
}Run the example to see the actual result.
HTTP alternative
POST https://app.getsupers.com/sites/agent-interval-sets/call
Content-Type: application/json
{
"left": [
[
0,
3
],
[
2,
5
],
[
7,
8
]
],
"right": [
[
"1/2",
"5/2"
],
[
4,
7
]
]
}The HTTP and MCP interfaces execute the same implementation. Validation errors are returned explicitly. See the tool notes above for its supported inputs and behavior.