Skip to main content
Glama

Get Prompt Version Stats

get_prompt_version_stats
Read-onlyIdempotent

Aggregate LLM performance stats by prompt name and version to compare latency, token usage, and errors across prompt variants.

Instructions

Get aggregated performance stats grouped by prompt name and version.

Groups spans by gen_ai.prompt.name + gen_ai.prompt.version, mirroring Langfuse's shipped per-prompt Metrics tab. Real-world adoption of these two attributes is still thin, so this tool may often return an empty list until more instrumentations populate them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum spans to analyze (default: 1000)
end_timeNoEnd time in ISO 8601 format
start_timeNoStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
service_nameNoFilter by service name
gen_ai_systemNoFilter by LLM provider (openai, anthropic, etc.)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.11.0
    • addedInput schema / properties / end_time / description
      Added value: +"End time in ISO 8601 format"
    • addedInput schema / properties / gen_ai_system / description
      Added value: +"Filter by LLM provider (openai, anthropic, etc.)"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum spans to analyze (default: 1000)"
    • addedInput schema / properties / service_name / description
      Added value: +"Filter by service name"
    • addedInput schema / properties / start_time / description
      Added value: +"Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)"
  2. Addedv0.5.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive behavior, so the bar for description-added context is lower. The description adds valuable behavioral disclosure by warning that 'real-world adoption of these two attributes is still thin' and that the tool 'may often return an empty list until more instrumentations populate them.'

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 three short sentences with no filler. The core action is front-loaded, the grouping detail is explained precisely, and the sparse-adoption caveat earns its place as important operational guidance.

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?

With a full input schema, an output schema, and safety-related annotations, the description covers the essentials. It also supplies the non-obvious expectation about possible empty results. The only missing context is explicit guidance on when to choose this tool over sibling stats tools, which is not strictly necessary for invoking it correctly.

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 the input schema already documents all five parameters. The description adds no additional parameter-level semantics beyond the grouping concept, so the baseline score of 3 is appropriate.

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 opens with a specific verb and resource: 'Get aggregated performance stats grouped by prompt name and version.' It also reinforces the grouping by naming the concrete span attributes and referencing Langfuse's per-prompt Metrics tab. It does not explicitly distinguish itself from sibling tools, but the grouping and naming make its purpose clear.

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?

The description implies when to use the tool through the Langfuse per-prompt Metrics analogy and the caveat about sparse adoption. However, it never explicitly states when to prefer this tool over alternatives like get_llm_model_stats or get_session_stats, nor does it mention any exclusions.

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