Skip to main content
Glama

ck_budget

Estimate, commit, or check agent operation costs against session and daily spend budgets. Prevents overspending before expensive multi-agent work or large model calls.

Instructions

Estimate, record, or check the cost of an agent operation against session and daily spend budgets. Three modes: estimate (read-only, returns headroom and projected cost); commit (write — deducts estimated_cost_cents from the session budget); status (read-only, returns remaining budget). For commit mode: pass session_id, estimated_cost_cents, provider, model, input_tokens, and output_tokens. Pass include_token_overhead: true with project_root to attach a token overhead audit (rule files, skill duplicates, tool schemas) to the response. Check ck_budget before expensive multi-agent work or large model calls. Use ck_cost_optimizer for model price comparisons without recording spend.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cached_input_tokensNoNumber of tokens served from cache.
estimated_cost_centsNoEstimated cost of the operation in US cents.
include_token_overheadNoWhen true, attach a token overhead summary (rule files, skill duplicates, tool schemas) to the response.
input_tokensNoNumber of input (prompt) tokens consumed.
metadataNoArbitrary key-value metadata for extensibility and audit context.
modeNoOperation mode that determines the tool behavior and return shape.
modelNoAI model identifier (e.g., gpt-4, claude-sonnet-4.6).
output_tokensNoNumber of output (completion) tokens generated.
project_rootNoAbsolute path to project root. Required when include_token_overhead is true.
providerNoAI provider name (e.g., openai, anthropic, ollama).
session_idYesUnique session identifier for correlating findings, proofs, budget, and audit trail.
sourceNoSource system or component that triggered the cost.
task_idNoTask identifier within the session for scoped operations.
toolNoSpecific tool or operation that incurred the cost.
Behavior5/5

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

With no annotations, the description fully discloses behavior: commit deducts from session budget, estimate is read-only, status returns remaining budget. It also explains the include_token_overhead parameter and its tie to project_root.

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 with no wasted words. The structure front-loads purpose, then details modes, parameter requirements, and usage guidance.

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?

Despite having 14 parameters and no output schema, the description provides enough context for correct usage, including mode-specific parameter requirements and token overhead audit explanation. It covers all needed details without being verbose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds value by specifying required parameters for each mode (e.g., for commit mode: session_id, estimated_cost_cents, provider, model, input_tokens, output_tokens). It also clarifies the relationship between include_token_overhead and project_root.

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?

The description clearly states the tool's three modes (estimate, commit, status) and uses specific verbs like 'Estimate, record, or check the cost'. It distinguishes itself from the sibling ck_cost_optimizer by noting it records spend, unlike the optimizer.

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?

Explicitly states when to use: 'Check ck_budget before expensive multi-agent work or large model calls'. Also provides an alternative: 'Use ck_cost_optimizer for model price comparisons without recording spend'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aryaminus/controlkeel'

If you have feedback or need assistance with the MCP directory API, please join our Discord server