Skip to main content
Glama

Agent Spend Report

ledger_report
Read-onlyIdempotent

Generate an agent spend report for a rolling window, including totals, rail/service breakdowns, budget status, anomalies, and entry counts.

Instructions

Spend report for an agent over a rolling window.

Returns total spend, breakdown by rail and by service, budget status (ok/warning/exceeded), detected anomalies, and entry count.

Requires a credential: either the agent's own agent_secret or its workspace's workspace_key (same rule as GET /v1/report).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "ledger_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoreport window in days (default 30)
agent_idYesunique agent identifier
agent_secretNothe agent's own secret (either this or workspace_key)
workspace_keyNothe owning workspace's key (either this or agent_secret)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.7

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, and non-destructive behavior, so the description carries a lighter burden. It adds valuable context by specifying the credential requirement (agent_secret or workspace_key, same rule as GET /v1/report) and summarizing the return contents, though it does not cover rate limits or pagination.

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?

The description is three sentences that are front-loaded with purpose, then returns, then credential requirement. Every sentence earns its place with no redundancy or filler.

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?

Given the presence of an output schema, annotations, and full schema coverage, the description is complete enough: it explains the report's purpose, summarizes return values, and states the credential rule. It only lacks explicit usage guidance relative to sibling tools, which prevents a 5.

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%, so the schema already documents all four parameters. The description reinforces the credential rule but adds no syntax or format details beyond what the schema provides, making the baseline 3 appropriate.

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 states a clear verb ('spend report') and resource (agent spend over a rolling window), and it enumerates the key outputs such as total spend, breakdowns, budget status, and anomalies. However, it does not explicitly differentiate this tool from siblings like ledger_alerts or ledger_track, so it stops short of the top score.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use this tool versus alternatives such as ledger_alerts, ledger_track, or ledger_set_budget. It only states what the tool returns and its credential requirement, leaving usage decisions to inference.

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