MCP max_spend_exceeded: how Sume compares a dry run to your cap

max_spend_usd is optional on Sume's paid MCP tools, from 0 to 10,000. If the estimate is higher, max_spend_exceeded stops the call before it bills.

4 min readSume
All posts

On Sume's hosted MCP server, a paid tool takes an idempotency_key, and two optional safety arguments: dry_run, which returns an admission and cost preview without submitting, and max_spend_usd, which the docs say Sume enforces only when you provide it. If you give a cap and the estimate is higher, the call fails with max_spend_exceeded and nothing is submitted.

The rule, exactly

max_spend_usd must be a number from 0 to 10,000. The server turns it into micro-dollars and rounds down, so a cap of 0.2 is 200,000 micros. It then reads the billable amount from the admission preview and compares the two. If billable is larger, the tool fails with the message "Estimated Sume usage exceeds max_spend_usd."

The error data carries the estimate as billable_amount_usd, billable_amount_usd_micros and billable_amount_usd_cents, plus the max_spend_usd you sent and, for model tools, the whole preview. The cents value rounds up, while the micros value is exact. Use the micros field for any comparison in code.

The second error

If the preview has no integer billable amount, the server cannot verify the estimate, so it refuses with the code missing_usage_estimate rather than letting the call through unchecked. A cap that cannot be checked is not treated as passed. Do not remove the cap to get past it.

max_spend_usd outcomes in Sume's MCP code (read 2026-10-05)
SituationResult
No max_spend_usd sentNo cap check
Estimate at or under the capCall goes ahead
Estimate over the capmax_spend_exceeded, nothing submitted
Preview without an integer estimatemissing_usage_estimate
max_spend_usd outside 0 to 10,000Argument error

A pattern for agents

Run the tool with dry_run set to true. Read billable_amount_usd_micros from the preview. Decide in your own code whether it is acceptable, and then call again with dry_run omitted, the same idempotency_key and a max_spend_usd just above the previewed amount. The cap then guards against a price change between the two calls.

Keep in mind what the cap is not. It does not limit a run of many calls: each call is checked alone. For a budget over a whole session, count the estimates you accepted in your own loop.

{
  "idempotency_key": "promo-17-clip-1",
  "dry_run": true,
  "max_spend_usd": 2,
  "payload": { "prompt": "a slow product turntable" }
}

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume