Skip to main content
Glama

Cost and tokens

cost
Read-onlyIdempotent

Retrieve daily agent spend and token usage for a repository or all repositories, with totals by model using Caprock's model table.

Instructions

Agent spend and tokens per day for a repository (or all of them), with totals by model. Figures are Caprock's, priced from its model table.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoDays back, today included (default 7, at most 90).
repoNoA directory inside the repository; defaults to the directory this server was started in (normally the project the agent is working in).
all_reposNoEvery repository, with a total per repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description goes beyond that by disclosing data provenance — 'Figures are Caprock's, priced from its model table' — which tells the agent the numbers are internally priced estimates rather than provider billing actuals, a meaningful trust caveat. It omits currency, day-boundary timezone, and data freshness, so it is not fully transparent.

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?

Two short sentences, front-loaded with the primary metric and scope, with the second sentence reserved for the pricing-provenance caveat. Nothing is redundant or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only, three-parameter, zero-required tool with no output schema, the description adequately sketches both scope and return shape (daily figures with per-model totals) and flags the pricing source. Remaining gaps — currency, day-boundary definition, and refresh cadence — are minor for a reporting tool but would matter to an agent quoting exact costs.

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 coverage is 100%, so days, repo, and all_repos are already fully documented including defaults and the 90-day cap. The description only restates the repo-vs-all scoping and the per-day/totals-by-model output shape, adding no syntax or edge-case meaning beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource (agent spend and tokens) and its granularity (per day, per repository or across all, with totals by model), which is unmistakable and does not overlap with any sibling such as ci_status or session_summary. It lacks an explicit verb ('get'/'report') but the noun phrase is precise enough that an agent knows exactly what it retrieves.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The parenthetical '(or all of them)' signals the two scoping modes and implicitly when to choose one over the other, but there is no explicit when-to-use guidance, no exclusions, and no statement of when this tool would be the wrong choice. Usage must be inferred from the scope phrasing rather than stated.

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