Skip to main content
Glama
abhishekash

MCP Trace Inspector

token_usage

Retrieve token and cost totals from OpenTelemetry traces, and aggregate usage across all runs when no trace ID is provided.

Instructions

Token and cost totals. Omit trace_id to aggregate across all runs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and it discloses almost nothing. It does not state that this is a read-only query, what cost basis or currency is used, or whether the aggregate covers all time or a bounded window. For a metrics tool with zero annotation coverage this is a real gap.

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 sentences, no filler, and the default-behavior guidance is front-loaded as the second sentence right where the agent needs it. Nothing could be cut without losing information.

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

Completeness3/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-value shape is covered, and with one optional parameter the schema surface is small. Still, for a cost-reporting tool that aggregates across runs, the description omits the aggregation scope (all time? bounded?) and the read-only nature, leaving meaningful agent questions unanswered.

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 description coverage is 0% and the single optional trace_id parameter has only a bare type declaration, so the description is the sole source of meaning. It supplies exactly the key semantic: omit it to aggregate across all runs, provide it to scope to that trace. Only the accepted ID format is left unstated.

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?

"Token and cost totals" names both resources the tool returns (tokens and cost), which is specific enough to distinguish it from generic stats siblings like tool_stats or run_summary. It is a noun phrase rather than a verb+resource, and it does not explicitly contrast with any sibling, so it falls short of a 5.

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?

"Omit trace_id to aggregate across all runs" implicitly tells the agent the two usage modes (scoped to one trace vs. global), which is useful. However, it never says when to prefer this tool over tool_stats, run_summary, or compare_runs, so routing between siblings is left entirely to inference.

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