Skip to main content
Glama

compute_token_percentiles

Calculate token usage percentiles (TP50, TP90, TP95, TP99) across traces. Group results by domain to identify usage patterns.

Instructions

Compute token usage percentiles (TP50/TP90/TP95/TP99) across traces.

Fetches generation observations to get per-trace token counts. Optionally group by 'domain' or other trace attribute.

NOTE: Fetches observations per trace — can be slow for large date ranges. Use last_7_days or smaller for real-time results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
projectNo
end_dateNo
group_byNo
start_dateNo
time_rangeNo
percentilesNo50,90,95,99

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the transparency burden. It discloses the underlying behavior ('Fetches generation observations to get per-trace token counts') and the performance implication (per-trace fetching can be slow). This is valuable beyond the official title and adds context about how the tool works, though it omits details about return structure and edge cases.

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 compact and front-loaded with the core purpose. Each sentence adds value: the function, the data source, the grouping option, and a performance note. No wasted words.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although an output schema exists (so returns needn't be described), the tool has seven parameters, no annotations, and 0% schema description coverage. The description only touches on two parameters and omits the rest, making it incomplete for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description provides almost no parameter semantics. It mentions 'domain' as an example for group_by and 'last_7_days' as a time_range value, but leaves tags, project, start_date, end_date, and percentiles undocumented. Given seven parameters, this is inadequate compensation for the lack of schema descriptions.

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 clearly states the tool's function with a specific verb and resource: 'Compute token usage percentiles (TP50/TP90/TP95/TP99) across traces.' This distinguishes it from sibling analysis tools like estimate_costs or analyze_latency by focusing on token usage percentiles.

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

Usage Guidelines4/5

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

Provides clear usage context, including the note about performance ('can be slow for large date ranges') and a recommendation to use 'last_7_days or smaller for real-time results.' It also mentions optional grouping by domain. However, it does not explicitly name alternatives or when-not-to-use conditions, stopping short of a full guidelines treatment.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DrishtantKaushal/LangfuseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server