Skip to main content
Glama

aggregate_by_group

Aggregate trace metrics by user group to compare performance, usage, and costs across segments. Returns counts, accuracy, latency, and cost per group, sorted by volume.

Instructions

Aggregate trace metrics by user group.

Returns per-group: trace count, unique sessions, unique users, accuracy rate, average latency, total cost. Sorted by trace count.

group_by options:

  • 'name': trace/agent name (default — works for everyone)

  • 'userId': per-user breakdown

  • 'domain': extracts domain from email-based user IDs (e.g. user@acme.com → acme.com)

  • 'tag': groups by trace tags

Set exclude_internal=true and LANGFUSE_INTERNAL_DOMAINS env var to filter out internal team users (only relevant with group_by='domain').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
top_nNo
projectNo
end_dateNo
group_byNoname
start_dateNo
time_rangeNo
exclude_internalNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the sorting order, default group_by, and domain extraction behavior, but does not mention permissions, side effects, or performance characteristics. This is adequate but incomplete.

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?

The description is well-structured with bullet points for group_by options, making it scannable. It is slightly verbose for the information provided but not excessively long.

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?

With 8 optional parameters and an output schema present, the description covers the core grouping behavior and return fields, but omits details on filtering parameters and time range semantics. This leaves some gaps for a tool with this many parameters.

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%, so the description must compensate. It explains group_by and exclude_internal, but leaves tags, top_n, project, dates, and time_range without explanation. Only a quarter of parameters receive clarification.

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 aggregates trace metrics by user group, listing specific output metrics and group_by options. It distinguishes itself from sibling analytics tools by specifying the grouping capability and output fields.

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?

The description provides clear context on when to use each group_by option and notes the exclude_internal caveat for domain grouping. However, it does not explicitly mention alternatives or when not to use this tool, so it falls short of full explicit guidance.

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