Skip to main content
Glama

WritersLogic business agents

allocate

Split a money amount into parts that sum exactly to the total — Splits one signed amount into up to 500 parts by weights (or equal parts), in integer minor units of its currency, for an agent dividing a bill, a refund, a fee or a tax. Each share is rounded under the declared mode, then the leftover minor units are assigned by the declared remainder policy, so the parts always sum to the total exactly. Negative totals (refunds) are supported; zero-weight parts

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "total": "<total>"
    },
    "name": "allocate"
  }
}

Input Schema

NameRequiredDescriptionDefault
partsNoEqual split into this many parts.
totalYesDecimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats.
weightsNoNon-negative decimal-string weights, e.g. ["1","1","2"] or percentages. Give weights or parts.
currencyNoISO 4217 alphabetic code, upper case.
exponentNoOverride the ISO 4217 exponent; required for codes not on the list.
roundingNoRounding of each share before the residual is moved. Default half-even. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity.
remainderNolargest-remainder (default): one unit at a time to the part with the largest rounding claim, ties to the lowest index. first / last: the whole residual to the first / last part with positive weight.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the exact-sum invariant, the two-stage algorithm (round each share, then distribute residual minor units under the declared remainder policy), and that negative totals for refunds are supported. Gaps remain: the return value is never described (no output schema exists), behavior when currency/exponent is omitted is unclear, and the sentence about zero-weight parts is cut off mid-thought.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core guarantee is front-loaded, which is good, but the opening clause is immediately restated after the em-dash ("Splits one signed amount into up to 500 parts"), costing a sentence that earns little. The definition also terminates mid-sentence — "zero-weight parts " — leaving a truncated fragment that undermines polish.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter, schema-rich but annotation-poor and output-schema-less tool, it explains the semantics and invariants well. It is incomplete on what the call returns (a list of minor-unit shares?), on the currency/exponent interaction, and on the zero-weight case the final fragment abandons.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already carries the meaning of total, parts, weights, currency, exponent, rounding and remainder in detail. The description adds only the 500-part ceiling, the weights-or-parts choice, and the minor-units framing, all of which are largely echoed in the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Split a money amount into parts that sum exactly to the total" states a specific verb and resource, then narrows scope to a signed amount divided into up to 500 weighted or equal parts in minor units. The guarantee of exact summation is stated up front, so an agent knows precisely what the tool produces without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names concrete use cases — dividing a bill, a refund, a fee or a tax — which tells the agent when the tool applies. It stops short of exclusions or of routing to any alternative (e.g. a single-value rounding tool), so the guidance is contextual rather than fully prescriptive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources