Skip to main content
Glama

ck_budget

Estimate, record, or check agent operation costs against session and daily spend budgets before running 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?

The description fully discloses behavior: explains that estimate and status are read-only, commit is a write operation that deducts from session budget, and mentions optional token overhead attachment. Annotations only provide hints, but the description gives concrete behavioral details 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.

Conciseness5/5

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

Four concise sentences that efficiently convey purpose, modes, usage guidance, and parameter hints. Front-loaded with key information, no redundant or vague phrasing.

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 complexity (three modes, 14 parameters, nested objects), the description covers all essential aspects: mode behavior, required params per mode, integration with token overhead, and link to sibling tool. Has output schema (context says true), so return values are documented elsewhere.

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?

While schema covers all parameters, the description adds crucial context: specifies required parameters for commit mode (session_id, estimated_cost_cents, provider, model, input_tokens, output_tokens) and explains include_token_overhead requires project_root. This goes beyond schema descriptions.

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 purpose: 'Estimate, record, or check the cost of an agent operation against session and daily spend budgets.' It explicitly describes three modes (estimate, commit, status), distinguishing it from sibling tools like 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 'Use ck_cost_optimizer for model price comparisons without recording spend.' This clearly indicates when to use this tool 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