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.

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.
| Situation | Result |
|---|---|
| No max_spend_usd sent | No cap check |
| Estimate at or under the cap | Call goes ahead |
| Estimate over the cap | max_spend_exceeded, nothing submitted |
| Preview without an integer estimate | missing_usage_estimate |
| max_spend_usd outside 0 to 10,000 | Argument 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
- MCP missing_tool_argument vs invalid_tool_argument: three look-alikes
Sume's MCP server has three near-identical codes: missing_tool_argument, invalid_tool_argument and invalid_tool_arguments. Learn which field each one names.
- MCP 503 mcp_oauth_unavailable vs 401: do not re-sign-in
A bad OAuth token gets 401 with WWW-Authenticate; a server fault gets 503 mcp_oauth_unavailable or mcp_oauth_not_configured. Retry on 503, sign in only on 401.
- MCP OAuth invalid_grant: four causes at Sume's token endpoint
The Sume MCP token endpoint answers invalid_grant with one of five messages. They group into four causes: reuse, expiry, mismatch and a bad PKCE verifier.
- PKCE plain is rejected: Sume's MCP OAuth accepts S256 only
A remote MCP client that sends code_challenge_method=plain gets invalid_request from Sume. The server advertises S256 only, so set it and keep the verifier.
Written by Sume