Tools for agents: Generalized modular-congruence solver
Combine integer repeating-cycle constraints into one complete solution progression or an explicit incompatibility witness.
Connect with MCP
{
"mcpServers": {
"super-agent-tools": {
"url": "https://app.getsupers.com/sites/agent-congruences/mcp"
}
}
}Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.
Call solve_congruences
Each constraint is [remainder,modulus], meaning x is congruent to remainder modulo modulus. Moduli must be positive JSON integers; remainders may be negative. Booleans, floats and quoted numbers are rejected. Moduli need not be coprime. A consistent result describes every integer solution as x=remainder+k*modulus for any integer k, with the least nonnegative remainder and positive combined modulus. Output integers are decimal strings to preserve arbitrary precision in clients. Empty constraints mean every integer and return remainder 0, modulus 1. Duplicate compatible constraints do not change the solution. An inconsistent result has no solution and supplies the first conflicting input index, the already-combined prefix, the incoming normalized constraint, and their gcd; the difference is not divisible by that gcd. All moduli are validated before solving. This is exact integer arithmetic, not calendar scheduling, time-zone conversion, task execution or a cryptographic protocol.
Input and output schemas
{
"name": "solve_congruences",
"title": "Generalized modular-congruence solver",
"description": "Solve simultaneous x = remainder modulo modulus constraints with positive integer moduli. Return the complete arithmetic progression or a conflicting prefix witness.",
"inputSchema": {
"properties": {
"constraints": {
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
],
"type": "array"
},
"title": "Constraints",
"type": "array"
}
},
"required": [
"constraints"
],
"title": "solve_congruencesArguments",
"type": "object"
},
"outputSchema": {
"additionalProperties": true,
"title": "solve_congruencesDictOutput",
"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-congruences/call
Content-Type: application/json
{
"constraints": [
[
2,
6
],
[
5,
9
],
[
14,
15
]
]
}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.