Skip to main content
Glama
langfuse-mcp

langfuse-mcp

by avivsinai

get_error_count

Count traces and error-level observations within a recent time window to monitor application reliability and surface failures for debugging.

Instructions

Get number of traces with error-level observations in last N minutes.

Args:
    ctx: Context object containing lifespan context with Langfuse client
    age: Number of minutes to look back; capped by the configured maximum

Returns:
    Dictionary with error statistics: trace_count (distinct traces), observation_count
    (error-level observations), and exception_count (the same error-observation total
    as find_exceptions, not a count of individual exception events; see metadata.note).

Input Schema

NameRequiredDescriptionDefault
ageYesNumber of minutes to look back (positive integer, max 7 days/10080 minutes)

Output Schema

NameRequiredDescriptionDefault

No arguments

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, the description carries the full behavioral burden. It usefully explains the return fields and the subtle exception_count semantics, but it does not explicitly state that the operation is read-only, whether permissions are required, or what rate-limit behavior to expect.

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 is front-loaded and the Args/Returns structure is easy to scan. The Args section mentions a ctx parameter that is not present in the input schema, which is minor noise in an otherwise efficient description.

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 simple one-parameter read/count tool with an output schema and full schema coverage, the description provides enough to call it correctly. It is somewhat incomplete on sibling routing and safety context, but the core operation and return shape are covered.

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 coverage is 100%, and the single age parameter is fully documented in the schema with its 7-day maximum. The description repeats the lookback meaning and mentions the configured cap, but adds no additional syntax or constraints beyond the schema.

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 uses a specific verb and resource: counting traces with error-level observations in a recent time window. It is clear enough to identify the operation, but it does not explicitly differentiate itself from siblings such as find_exceptions or query_metrics.

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?

The description states what the tool does but gives no explicit when-to-use guidance, exclusions, or alternatives. It references find_exceptions only to clarify the meaning of exception_count, not to help select between tools.

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