Skip to main content
Glama

Report a finished review's token usage

report_review_usage
DestructiveIdempotent

After the main session submits one whole-mod review, report exact usage summed across its reviewing subagents: taskId, inputTokens (uncached), outputTokens, cacheReadTokens and cacheWriteTokens. All four counts are required together. totalTokens alone remains a fallback with unknown split. Claude Code: read transcripts by agentId, counting each assistant message.id once, never its displayed context-size total. Codex: use exact session log token-count events if available, otherwise skip. Only your own submitted reviews, within a day. Identical reports are a no-op; different counts or splits are refused. Never guess or send transcripts. AI tokens given to defense means total processed, the sum of all four.

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": {
      "taskId": "<taskId>"
    },
    "name": "report_review_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskIdYesThe whole-mod task submitted by this account.
inputTokensNoUncached input tokens.
totalTokensNoFallback only: processed total with unknown split.
outputTokensNo
cacheReadTokensNo
cacheWriteTokensNo

Output Schema

NameRequiredDescriptionDefault
taskIdYes
recordedYes
alreadyReportedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: identical reports are a no-op, divergent counts or splits are refused, and reports are limited to your own reviews within a day — consistent with idempotentHint=true. However, destructiveHint=true is never explained; the description does not say what gets overwritten, consumed, or made unrecoverable, which is the one trait an agent most needs before calling a write tool.

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?

Dense and front-loaded: the operation, required fields, and counting rules come before the platform-specific procedures. Some sentences are compressed to the point of ambiguity ("read transcripts by agentId, counting each assistant message.id once") and the closing line about AI tokens given to defense is awkward and only loosely tied to the preceding content.

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?

An output schema exists, so return values need no explanation, and the description covers preconditions, counting methodology per platform, the fallback parameter, idempotency, and refusal behavior. The remaining gap is the unexplained destructiveHint=true — an agent is told reports can be refused but not what is at risk if the write succeeds.

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?

Schema coverage is only 50%, but the description compensates fully: it names all five token fields, clarifies that inputTokens is uncached, and states that all four counts must be supplied together — a constraint the schema does not encode, since only taskId is required. It also defines totalTokens as a fallback for an unknown split, which is the key disambiguation between the two parameter modes.

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?

States a specific verb and resource (report usage for a finished whole-mod review) plus the precondition (after the main session submits one whole-mod review). The field list (taskId, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens) makes the operation concrete and distinguishes it from submit_review or get_review_task.

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?

Explicit about when to use it (after submission of a whole-mod review), the eligibility scope (only your own submitted reviews, within a day), the fallback path (totalTokens alone when the split is unknown), and a platform-specific when-not (Codex: skip if exact session log events are unavailable). It also forbids guessing or sending transcripts, which closes off the main misuse path.

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.

Resources