Skip to main content
Glama
avivsinai

langfuse-mcp

by avivsinai

find_exceptions_in_file

Find exceptions in a file by code.filepath and time window, retrieving compact summaries or full JSON error details for debugging Langfuse traces.

Instructions

Get detailed error info for a specific file (recorded code.filepath match).

Args:
    ctx: Context object containing lifespan context with Langfuse client
    filepath: Path to the file as recorded in Langfuse metadata (code.filepath)
    age: Number of minutes to look back; capped by the configured maximum
    output_mode: Controls the output format and detail level

Returns:
    Based on output_mode:
    - compact: List of summarized error records (top 10 newest after the full scan)
    - 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
ageYesNumber of minutes to look back (positive integer, max 7 days/10080 minutes)
filepathYesPath to the file to search for exceptions (full path including extension)
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.4/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 disclosure burden. It does add useful behavioral detail—age is 'capped by the configured maximum' and output_mode governs format—but never states this is a read-only operation, nor anything about permissions or result size limits beyond the top-10 note.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-line purpose is well front-loaded, but the body is padded docstring boilerplate (Args/Returns with a ctx parameter that isn't even in the schema). The Returns section is helpful but partly redundant with the existing output schema.

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?

An output schema exists, so return values need not be re-explained, yet the description usefully summarizes the three output_mode behaviors. Combined with 100% param coverage, an agent has enough to invoke it correctly; only sibling routing is left implicit.

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 schema already documents all three parameters thoroughly (including the 10080-minute cap and enum semantics). The description largely restates this; the only marginal addition is the 'capped by the configured maximum' phrasing. Baseline 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?

States a specific verb (Get), resource (detailed error info), and scope constraint (specific file, code.filepath match), which distinguishes it from the broader find_exceptions sibling. It doesn't explicitly name which sibling to prefer, but the file-scoped framing is 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 '(recorded code.filepath match)' note implies when this applies versus a general exceptions search, but there is no explicit when-to-use/when-not guidance or routing to sibling tools like find_exceptions or get_exception_details. Usage is only implied.

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