Skip to main content
Glama

ck_budget

Estimate or commit AI operation costs against session and daily budgets. Check remaining budget to control spend before expensive multi-agent work.

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
modeNoOperation mode that determines the tool behavior and return shape.
toolNoSpecific tool or operation that incurred the cost.
modelNoAI model identifier (e.g., claude-sonnet-4.6, o4-mini).
sourceNoSource system or component that triggered the cost.
task_idNoTask identifier within the session for scoped operations.
metadataNoArbitrary key-value metadata for extensibility and audit context.
providerNoAI provider name (e.g., openai, anthropic, ollama).
session_idYesUnique session identifier for correlating findings, proofs, budget, and audit trail.
input_tokensNoNumber of input (prompt) tokens consumed.
project_rootNoAbsolute path to project root. Required when include_token_overhead is true.
output_tokensNoNumber of output (completion) tokens generated.
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.

Output Schema

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

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

Despite annotations having readOnlyHint=false (not read-only in all modes), the description clarifies that estimate and status are read-only while commit is write (deducts from budget). It also discloses token overhead audit behavior. No contradictions with annotations.

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?

Approximately 100 words, well-structured into mode enumeration and usage notes. Every sentence is informative without redundancy. Front-loaded with core purpose.

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 14 parameters (1 required), nested objects, output schema, and complex multi-mode behavior, the description covers modes, required parameters per mode, token overhead audit, and cross-references sibling tool. Complete for agent invocation.

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

Parameters4/5

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

Schema coverage is 100%, but description adds valuable context: specifies which parameters are required per mode (e.g., commit mode needs session_id, estimated_cost_cents, etc.) and explains include_token_overhead usage with project_root. Enhances beyond schema alone.

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?

Description explicitly states three modes (estimate, commit, status) and the overall function of estimating, recording, or checking costs. The verb 'Estimate, record, or check' and resource 'cost of an agent operation' are specific. It also distinguishes from sibling ck_cost_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?

Provides explicit guidance: 'Check ck_budget before expensive multi-agent work or large model calls' and directs to ck_cost_optimizer for model price comparisons without recording spend, giving clear when-to-use and when-not-to-use.

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