Skip to main content
Glama
OpenTelemetry MCP Server

OpenTelemetry MCP Server

by traceloop

Get Llm Expensive Traces

get_llm_expensive_traces

Find LLM traces with high token usage to support cost optimization and identify inefficient prompts.

Instructions

Find traces with highest LLM token usage.

Useful for cost optimization and identifying inefficient prompts.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_llm_expensive_traces"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of traces to return (default: 10)
end_timeNoEnd time in ISO 8601 format
min_tokensNoMinimum token count threshold (only return traces above this)
start_timeNoStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
service_nameNoFilter by service name
gen_ai_request_modelNoFilter by requested model name (e.g., "gpt-4")
gen_ai_response_modelNoFilter by actual model used (e.g., "gpt-4-0613")

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It implies a read-only, ranked query, but does not confirm sort direction, state that results are capped by default, or describe any cost/latency traits of a token-aggregation scan. Return values are covered by the output schema, which limits the gap.

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?

Two short sentences with the core behavior front-loaded and the use case second. No filler, though the second sentence is somewhat generic advice rather than operational detail.

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?

For a seven-parameter query tool with an output schema and no annotations, the description covers what it does and why, but says nothing about how the optional filters interact with the top-N ranking or about default behavior. Adequate but with clear gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters (limit, min_tokens, time window, service and model filters) are already documented in the schema. The description adds no additional meaning about how these interact with the 'highest token usage' ranking, so the baseline 3 applies.

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 states a specific verb and resource plus the ordering criterion: 'Find traces with highest LLM token usage.' That implicitly separates it from get_llm_slow_traces (latency) and get_llm_model_stats, though no sibling is named explicitly.

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?

'Useful for cost optimization and identifying inefficient prompts' gives a use-case context but no when-not guidance, no mention of the ranked/filtering alternatives in the sibling set, and no prerequisites. Usage is implied rather than directed.

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