Skip to main content
Glama
avivsinai

langfuse-mcp

by avivsinai

find_exceptions

Group error-level observations by file, function, type, name, or observation type to analyze and debug exceptions in Langfuse traces.

Instructions

Get error-level observations grouped by file path, function, type, name, or observation type.

Args:
    ctx: Context object containing lifespan context with Langfuse client
    age: Number of minutes to look back; capped by the configured maximum
    group_by: How to group errors - "file" groups by recorded code.filepath, "function" by code.function,
              "type" by recorded exception.type, "name" by observation name, or "observation_type" by
              observation type

Returns:
    List of error-observation counts grouped by the specified category. A group entry carries a
    representative observation_id and trace_id. Counts describe error-level observations, NOT
    individual exception events (which the standard observation listing does not expose).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ageYesNumber of minutes to look back (positive integer, max 7 days/10080 minutes)
group_byNoHow to group errors - 'file' groups by recorded code.filepath metadata, 'function' by code.function, 'type' by recorded exception.type, 'name' by observation name, or 'observation_type' by observation type. Missing recorded metadata groups as 'unknown'.file

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • changedInput schema / properties / group_by / description
      Previous value: -"How to group exceptions - 'file' groups by filename, 'function' groups by function name, or 'type' groups by exception type"New value: +"How to group errors - 'file' groups by recorded code.filepath metadata, 'function' by code.function, 'type' by recorded exception.type, 'name' by observation name, or 'observation_type' by observation type. Missing recorded metadata groups as 'unknown'."
    • changedInput schema / properties / group_by / enum
      Previous value: -[
      -  "file",
      -  "function",
      -  "type"
      -]New value: +[
      +  "file",
      +  "function",
      +  "type",
      +  "name",
      +  "observation_type"
      +]
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does add real value by disclosing that age is capped by a configured maximum, that missing recorded metadata groups as 'unknown', and that results are counts rather than individual exception events, but it says nothing about authorization, rate limits, or pagination behavior.

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?

Front-loaded with a one-line purpose followed by compact Args and Returns sections; each line earns its place. It is slightly padded by documenting the framework-injected 'ctx' parameter, which an agent cannot set.

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?

For a two-parameter read tool with 100% schema coverage and an output schema, the definition supplies everything needed including a high-level return shape. The mild gap is the absence of when-to-use routing against the many sibling exception/error tools.

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 both parameters are already fully documented in the schema, including the enum values and the 10080-minute cap. The description's Args section largely restates the schema text (group_by definitions, age semantics) with no added syntax or format detail, making the baseline 3 correct.

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 gives a specific verb+resource ('Get error-level observations grouped by...') and enumerates the five grouping dimensions, which clearly separates it from count-style siblings like get_error_count and detail-style siblings like get_exception_details. It stops short of naming any sibling explicitly, so an agent must infer the boundary with find_exceptions_in_file.

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?

Usage is implied by the grouping framing rather than stated: there is no 'use this when you want X instead of Y' guidance. The one routing signal is the note that this returns counts and NOT individual exception events, which implicitly steers the agent away from the standard observation listing, but the alternative tools are never named.

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