Skip to main content
Glama
avivsinai

langfuse-mcp

fetch_observations

Retrieve Langfuse observations filtered by type, age, name, user, trace, or parent observation. Supports pagination and compact, full JSON, or file output.

Instructions

Get observations filtered by type and other criteria.

Args:
    ctx: Context object containing lifespan context with Langfuse client
    type: The observation type to filter by (SPAN, GENERATION, or EVENT)
    age: Minutes ago to start looking (e.g., 1440 for 24 hours)
    name: Optional name filter (string pattern to match)
    user_id: Optional user ID filter (exact match)
    trace_id: Optional trace ID filter (exact match)
    parent_observation_id: Optional parent observation ID filter (exact match)
    page: Page number for pagination (starts at 1)
    limit: Maximum number of observations to return per page
    output_mode: Controls the output format and detail level

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoThe observation type to filter by ('SPAN', 'GENERATION', or 'EVENT')
ageYesMinutes ago to start looking (e.g., 1440 for 24 hours)
nameNoOptional name filter (string pattern to match)
user_idNoOptional user ID filter (exact match)
trace_idNoOptional trace ID filter (exact match)
parent_observation_idNoOptional parent observation ID filter (exact match)
pageNoPage number for pagination (starts at 1)
limitNoMaximum number of observations to return per page
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
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains output modes (compact, full_json_string, full_json_file) and mentions pagination (page, limit), which are key behavioral traits. However, it does not explicitly state that the operation is read-only or idempotent, which is acceptable for a fetch operation.

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 description is somewhat verbose with a Python docstring style (Args/Returns). The first sentence is clear, but the rest is lengthy with parameter listings that mirror the schema. Could be more concise and front-loaded.

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?

Given the complexity (9 parameters, output schema exists), the description covers filtering, pagination, and output modes well. The Returns section provides a useful breakdown of output based on output_mode. It is nearly complete, though it lacks mention of potential performance implications or large result set handling.

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 baseline is 3. The description's Args section largely repeats the schema's parameter descriptions without adding significant new meaning beyond summarizing them. The Returns section adds some value by explaining output modes, but this is partially covered in the output_mode schema description.

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 'Get observations filtered by type and other criteria.' It specifies the verb (get) and resource (observations), and the filtering criteria differentiate it from siblings like fetch_observation (which retrieves a single observation by ID).

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 provides no guidance on when to use this tool vs alternatives, such as fetch_observation for a single observation or other fetch tools. It lacks explicit 'when to use' or 'when not to use' context.

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/avivsinai/landfuse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server