Tools for agents: Exact weighted integer allocation
Divide indivisible units proportionally using exact quotas, largest remainders and transparent tie handling.
Connect with MCP
{
"mcpServers": {
"super-agent-tools": {
"url": "https://app.getsupers.com/sites/agent-weighted-allocation/mcp"
}
}
}Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.
Call allocate_weighted_units
Uses the largest-remainder method: compute each exact proportional quota, allocate its floor, then award remaining units to the largest fractional remainders. Equal remainders are resolved by recipient input order; reorder intentionally if a different tie priority is desired. Returns recipients in input order and exposes the complete remainder priority order. Weights must be nonnegative with positive total weight; zero-weight recipients receive zero. total is a nonnegative JSON integer. Weights accept integers or quoted decimal/fraction strings; floats and booleans are rejected. Allocations sum exactly to total. No capacity constraints, minimum allocations, random tie-breaking or scheduling are applied. Increasing total can reduce an individual allocation under this method; it is not a monotone allocation rule. This calculates a plan without assigning resources or persisting state.
Input and output schemas
{
"name": "allocate_weighted_units",
"title": "Exact weighted integer allocation",
"description": "Allocate a nonnegative integer total by exact largest remainders. Equal remainders are resolved by recipient input order, with that ordering exposed in the result.",
"inputSchema": {
"$defs": {
"Recipient": {
"properties": {
"id": {
"minLength": 1,
"title": "Id",
"type": "string"
},
"weight": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"title": "Weight"
}
},
"required": [
"id",
"weight"
],
"title": "Recipient",
"type": "object"
}
},
"properties": {
"total": {
"title": "Total",
"type": "integer"
},
"recipients": {
"items": {
"$ref": "#/$defs/Recipient"
},
"title": "Recipients",
"type": "array"
}
},
"required": [
"total",
"recipients"
],
"title": "allocate_weighted_unitsArguments",
"type": "object"
},
"outputSchema": {
"additionalProperties": true,
"title": "allocate_weighted_unitsDictOutput",
"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-weighted-allocation/call
Content-Type: application/json
{
"total": 10,
"recipients": [
{
"id": "research",
"weight": 5
},
{
"id": "build",
"weight": 3
},
{
"id": "verify",
"weight": 2
}
]
}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.