Skip to main content
Glama

Run Budget Guard

reserve

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.5/5.0
Behavior5/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 so: it discloses the side effect (deducts the estimate), the return contract (allowed true/false plus the tripping limit), the concurrency semantics ('Atomic, so parallel sub-agents cannot both slip under the cap'), and the mandated behavior on denial. That is more behavioral context than most definitions provide.

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?

Four sentences, zero filler, and the call timing constraint is front-loaded before the return semantics and the failure protocol. Each sentence carries distinct operational information.

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

Completeness5/5

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

For a gating tool with no output schema and no annotations, the description supplies everything needed: when to invoke, what the response fields mean, the concurrency guarantee, and what to do on denial. Nothing required to call it correctly is missing.

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 every parameter (usd, note, calls, handle, tokens) is already documented in the schema, including the handle format and the instruction to propagate it to sub-agents. The description adds no parameter-level meaning beyond 'your estimate', so the 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?

Specific verb (reserve) plus the exact trigger point ('BEFORE each model call, tool call or sub-agent spawn with your estimate') and the outcome ('Returns allowed=true and deducts it, or allowed=false with the limit that tripped'). This clearly separates it from siblings like open_budget (creates the handle) and record (post-hoc logging).

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?

Gives an explicit call condition ('BEFORE each model call, tool call or sub-agent spawn') and an explicit failure protocol ('stop, do not retry, and return your partial result to the user'), which is unusually actionable. It does not, however, name the sibling tools an agent might otherwise confuse it with (open_budget, record), which keeps it from a 5.

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