Skip to main content
Glama

cost-today

Retrieve total USD spent on Claude Code today by reading JSONL files, with per-model breakdown, deduplication stats, and pricing freshness.

Instructions

Custo Claude Code do dia corrente (USD + tokens por modelo) lendo JSONLs de ~/.claude/projects/. tz default UTC (paridade ccusage). Retorna shape canônico: total_usd, by_model, entry_count, deduped_count, skipped_entry_count, parse_error_count, unknown_models, pricing_source, pricing_staleness_days. Triggers: "quanto gastei hoje", "custo do dia", "spent today", "daily cost". Use cost-session para a sessão atual, cost-blocks para janelas de 5h, cost-phase para uma fase do framework.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
config_dirsNoOverride CLAUDE_CONFIG_DIR. Default: discovery automática (CLAUDE_CONFIG_DIR > XDG_CONFIG_HOME/claude > ~/.claude > %APPDATA%/claude no Windows).
tzNoIANA timezone (ex: America/Sao_Paulo). Default: UTC (paridade ccusage).
dateNoOverride YYYY-MM-DD do dia alvo (default: hoje no tz).
refresh_pricingNoOpt-in fallback models.dev pra modelos não cobertos pelo snapshot embedded. Default: false.
persistNoGrava snapshot em .planning/costs/<ts>.json (opt-in). Default: false.
projectRootNoPara persist: raiz do projeto. Default: cwd.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains the tool reads JSONL files, uses timezone defaults, and returns a canonical shape. It does not mention whether it modifies data or has side effects, but the description implies a read-only operation. The level of detail is good but could explicitly state non-destructive behavior.

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 reasonably concise, front-loading the core purpose. It includes relevant details without being overly verbose. Could be slightly more structured, but it's effective.

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 no output schema, the description thoroughly explains the return shape (total_usd, by_model, etc.). It covers timezone handling, default configurations, and provides trigger phrases. The tool has 6 parameters and no output schema, and the description addresses all necessary contextual information.

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%, with each parameter already well-documented. The tool description adds some context (e.g., 'opt-in' for certain params, 'paridade ccusage' for tz) but does not significantly enhance understanding beyond the schema. Baseline of 3 is appropriate.

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: calculating daily cost of Claude Code from local JSONL files. It specifies the output shape and provides trigger phrases. It distinguishes from sibling tools (cost-session, cost-blocks, cost-phase) by name and usage context.

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 explicitly tells when to use this tool versus alternatives: 'Use cost-session para a sessão atual, cost-blocks para janelas de 5h, cost-phase para uma fase do framework.' This provides clear usage guidance.

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/luanpdd/kit-mcp'

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