Skip to main content
Glama

ck_budget

Estimate, commit, or track AI operation costs against session and daily spend budgets to prevent budget overruns.

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
decisionNo
headroom_centsNo
modeNo
projected_cost_centsNo
remaining_daily_centsNo
remaining_session_centsNo
session_idNo
token_overheadNo
Behavior4/5

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

Annotations are minimal (readOnlyHint=false, destructiveHint=false) but the description adds key behavioral details: estimate and status are read-only, commit is a write that deducts from budget. It also explains the token overhead audit. This adds context beyond annotations without contradiction.

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

Conciseness4/5

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

The description is three paragraphs but each sentence adds value. It front-loads the three modes, then details specific mode parameters, then gives usage guidance. No redundancy, though slightly long for a concise description.

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?

Given the tool's complexity (14 parameters, 3 modes, output schema exists, nested objects), the description is complete. It covers all modes, required parameters per mode, the token overhead feature, and when to use it. No gaps for the complexity level.

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 the description adds significant semantic value: it specifies required parameters per mode (e.g., commit mode needs session_id, estimated_cost_cents, provider, model, input_tokens, output_tokens) and explains the interaction 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 three modes (estimate, commit, status) and explicitly distinguishes this tool from its sibling ck_cost_optimizer, which only handles price comparisons without recording spend. It uses specific verbs (estimate, record, check) and resource (budget).

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?

The description provides explicit guidance: 'Check ck_budget before expensive multi-agent work or large model calls' and 'Use ck_cost_optimizer for model price comparisons without recording spend.' This clearly tells when to use and when to use an alternative.

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