Skip to main content
Glama

Cloud for Bots

budget-guard: reserve

budget_reserve

[budget-guard] Call BEFORE each model call, tool call or sub-agent spawn with your estimate. Returns allowed=true and deducts it, or allowed=false with the limit that tripped. When allowed is false, stop, do not retry, and return your partial result to the user. Atomic, so parallel sub-agents cannot both slip under the cap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usdNoEstimated cost of the next call in USD.
noteNoShort note, e.g. "web_search #12".
callsNoNumber of calls to reserve (default 1).
handleYesThe budget handle from open_budget (looks like bg_<id>.<secret>). Pass it to every sub-agent so they all spend from the same budget.
tokensNoEstimated tokens of the next call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and largely succeeds: it discloses the return contract (allowed=true/false with the tripping limit), the side effect (deducts), and the concurrency guarantee (atomic, so parallel sub-agents cannot slip under the cap). It stops short of disclosing auth needs, idempotency/refund semantics for reservations, or rate limits, which keeps it from a 5.

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

Conciseness5/5

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

Front-loaded with the timing instruction, then the return contract, then the failure protocol, then the concurrency rationale. Every sentence earns its place with no padding or redundancy.

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

Completeness4/5

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

No output schema exists, and the description fills that gap by describing allowed=true/false results and the limit field. Combined with 100% schema coverage, an agent has enough to invoke correctly; only minor behavioral details (refund, expiry, auth) are absent.

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 all five parameters (usd, tokens, calls, note, handle) are already documented in the schema, including the handle format and sub-agent sharing guidance. The description adds essentially nothing parameter-specific beyond 'with your estimate', so baseline 3 is appropriate.

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?

States a specific verb and resource ('reserve' budget) and frames it precisely against the sibling budget_record workflow: reserve comes BEFORE the call, record comes after. The agent can tell this reserves/deducts budget rather than recording actual spend or reporting status. No ambiguity about the tool's role.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('Call BEFORE each model call, tool call or sub-agent spawn with your estimate') and explicit when-not plus remediation ('When allowed is false, stop, do not retry, and return your partial result'). The operational flow is fully prescribed, leaving no inference for the agent.

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