Skip to main content
Glama

agentguard — policy proxy for agent tool calls

agentguard_spend_report

Read-onlyIdempotent

Read an agent log and report what it spent: totals, calls by tool and by class, estimated dollars by rail, loops, the largest single run, and — for every overspend — the agentguard band whose cap would have stopped it, the exact cap, and the call that would have tripped it.

Needs no account and no key. The log is read in the request and discarded; nothing is stored. Accepts an agentwares audit export (agentwares.audit/v1), a Claude Code session .jsonl, or a CSV/JSONL of tool calls with any of tool, ts, class, amount_usd, rail, run_id, model, input_tokens, output_tokens.

Caps come from the proxy's own default policy, so a band named here refuses exactly what it says it refuses. Buying that band is a checkout a person completes; the calls-only purchase an unattended agent can complete is in agentguard_get_pricing instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
logYesThe log itself, verbatim — JSON, JSONL or CSV. Not a path and not a URL: this server does not fetch anything.
detailNo`concise` (default) returns the totals, the top ten tools, the rails, the loops and every overspend. `full` adds the complete per-tool breakdown and the window. Ask for `full` only when you are going to read it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnly/idempotent hints, the description adds meaningful behavioral context: 'The log is read in the request and discarded; nothing is stored' (privacy), 'Needs no account and no key' (auth), and the provenance of caps ('Caps come from the proxy's own default policy'), which explains why band refusals are authoritative. No contradiction with annotations; all claims align with readOnlyHint=true.

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?

Three paragraphs with zero filler: the first front-loads purpose and outputs, the second covers inputs and privacy, the third covers caps provenance and sibling routing. Every sentence earns its place, and the most decision-relevant information is placed first.

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?

With no output schema present, the description carries the full burden of explaining return contents — and it does so thoroughly, enumerating every report element and the difference between `concise` and `full`. Combined with the annotated safety profile, complete parameter docs, and alternative-routing, nothing an agent needs to invoke this correctly is missing.

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% and both parameter descriptions are already detailed (verbatim log content, no paths/URLs; concise vs full output). The description adds value by expanding the accepted format list with the exact field names (`tool`, `ts`, `class`, `amount_usd`, `rail`, `run_id`, `model`, `input_tokens`, `output_tokens`), which is genuinely useful beyond the schema.

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 opens with a specific verb+resource ('Read an agent log and report what it spent') and enumerates the full set of outputs: totals, calls by tool and class, estimated dollars by rail, loops, largest run, and per-overspend band/cap/tripping call. This unambiguous scope clearly distinguishes it from siblings like agentguard_export_audit (produces the log) and agentguard_set_policy (mutates policy).

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 routes the agent away from this tool for a related purchase task: 'the calls-only purchase an unattended agent can complete is in `agentguard_get_pricing` instead.' It also specifies accepted input types (audit export, Claude Code .jsonl, CSV/JSONL of tool calls) and gives usage conditions for the `detail` parameter ('Ask for `full` only when you are going to read it').

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.