Skip to main content
Glama
Pawangunjkar

agent-trace-mcp

by Pawangunjkar

trace_token_cost

Calculate total token cost for MCP tool call traces by summing input and output tokens. Provide a run_id to sum for a specific run, or omit it to aggregate the entire trace file.

Instructions

Sum input and output tokens. Omit run_id to sum the whole file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the burden. It communicates that this is an aggregation (sum) rather than a mutation and explains the file-wide versus run-scoped behavior triggered by omitting run_id. It does not discuss output shape, but an output schema is present.

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 core behavior and followed by the only parameter nuance. No filler or repetition of the schema.

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?

For a single-optional-parameter aggregation tool with an output schema, the description provides the purpose, the scope modes, and the behavior of the only parameter. Nothing needed to invoke it 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 0% and run_id only has a title and default, so the description must compensate. 'Omit run_id to sum the whole file' meaningfully explains the parameter's optional scope behavior, though it could say more explicitly that providing run_id sums only that run.

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 verb ('Sum'), a resource ('input and output tokens'), and a scope option (whole file vs. run). It does not explicitly contrast with sibling tools, but the computation it describes is unique among the trace_* siblings.

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?

It implies the tool is for token-count totals and gives a useful scope condition ('Omit run_id to sum the whole file'). It does not state when to prefer this over sibling tools such as trace_get_run or trace_status, so the guidance is implied rather than explicit.

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