Skip to main content
Glama

Run Budget Guard

open_budget

Open a hard budget for one agent run before it starts: max dollars, tokens, calls and/or wall-clock seconds. Returns a handle. Give the handle to every sub-agent; they all draw from the same ledger, so one runaway loop or fork cannot exceed the run cap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoshadow = watch only: track spend and flag where the cap WOULD have stopped the run, never block (free). enforce = return allowed=false at the cap (Pro). Default: enforce on Pro, shadow on free.
labelNoWhat this run is for, e.g. "nightly code cleanup".
max_usdNoDollar cap for the whole run (your own estimates per call).
max_callsNoCap on model/tool calls for the whole run.
ttl_hoursNoHandle lifetime (free max 24, Pro max 168). Default 24.
max_tokensNoToken cap (input + output) for the whole run.
max_secondsNoWall-clock cap in seconds from now.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/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 return value (a handle), the shared-ledger semantics across sub-agents, and the runaway-loop protection goal. The shadow/enforce behavioral distinction and free/Pro gating live in the schema rather than the description, which is an acceptable division but leaves the description slightly thin on enforcement semantics.

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?

Two tight sentences, front-loaded with the purpose before the mechanic of sharing the handle. Every clause earns its place with no filler.

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?

Since there is no output schema, the description correctly mentions that a handle is returned, and all seven parameters are covered by the schema. It is nearly complete, though it could say how the budget is later checked or closed to fully orient the agent.

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 baseline is 3. The phrase 'max dollars, tokens, calls and/or wall-clock seconds' loosely maps to max_usd/max_tokens/max_calls/max_seconds but adds no syntax or interaction detail beyond the schema, so it does not exceed the baseline.

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 (open) and resource (hard budget) with the exact scoping condition ('for one agent run before it starts'). The mention of a handle and a shared ledger distinguishes it clearly from budget_status, record, and reserve.

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?

Explicitly says to call it before the run starts and to pass the handle to every sub-agent, which gives clear situational context. It does not, however, contrast itself with siblings like reserve or record, so the agent must infer the boundary between opening a budget and recording/reserving against one.

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