Skip to main content
Glama
avivsinai

langfuse-mcp

by avivsinai

get_exception_details

Retrieve detailed exception information for a Langfuse trace or specific observation, returning compact summaries or full JSON to help debug LLM application errors.

Instructions

Get detailed error info for a trace/observation.

Args:
    ctx: Context object containing lifespan context with Langfuse client
    trace_id: The ID of the trace to analyze for errors (unique identifier string)
    span_id: Optional observation ID to filter by (applies across all observation types)
    output_mode: Controls the output format and detail level

Returns:
    Based on output_mode:
    - compact: List of summarized error records
    - full_json_string: String containing the full JSON response
    - full_json_file: List of summarized error records with file save info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
span_idNoOptional span ID to filter by specific span (unique identifier string)
trace_idYesThe ID of the trace to analyze for exceptions (unique identifier string)
output_modeNoControls the output format and action. 'compact' (default): Returns a summarized JSON object optimized for direct agent consumption. 'full_json_string': Returns the complete, raw JSON data serialized as a string. 'full_json_file': Returns a summarized JSON object AND saves the complete data to a file.compact

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden, and it does disclose the three output_mode behaviors including that full_json_file saves data to a file. It omits other behavioral context such as permissions, what happens when no exceptions exist for a trace, or rate limits, leaving meaningful gaps for a read tool with zero annotation coverage.

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 purpose sentence is front-loaded and the Args/Returns block is orderly. It is slightly padded by including 'ctx', a framework-injected object that is not a caller-supplied parameter, and the Returns section partly duplicates the existing output schema.

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?

An output schema exists, so return values need not be re-explained, and the description does cover its inputs. The notable gap is routing: with siblings like find_exceptions, find_exceptions_in_file, and get_error_count, the description never clarifies which situation selects this tool, leaving an agent to guess.

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 baseline is 3. The Args section largely restates the schema, but span_id adds 'applies across all observation types', which is genuine meaning not present in the schema text. The output_mode explanation mirrors what the schema already describes in comparable detail, so the net addition is modest.

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?

States a specific verb and resource: 'Get detailed error info for a trace/observation.' An agent can tell it retrieves error detail scoped to a trace or span. It does not, however, explicitly distinguish itself from close siblings such as find_exceptions or get_error_count, so the differentiation is left implicit.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus find_exceptions, find_exceptions_in_file, or get_error_count, which all live in the same error-inspection space. Usage is only implied by the verb 'Get detailed', with no conditions or exclusions stated.

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