fetch_observations
Get observations filtered by type, age, name, user, trace, or parent observation ID. Supports pagination and three output modes: compact, full JSON string, or file save.
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
| Name | Required | Description | Default |
|---|---|---|---|
| age | Yes | Minutes ago to start looking (e.g., 1440 for 24 hours) | |
| name | No | Optional name filter (string pattern to match) | |
| page | No | Page number for pagination (starts at 1) | |
| type | No | The observation type to filter by ('SPAN', 'GENERATION', or 'EVENT') | |
| limit | No | Maximum number of observations to return per page | |
| user_id | No | Optional user ID filter (exact match) | |
| trace_id | No | Optional trace ID filter (exact match) | |
| output_mode | No | Controls 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 |
| parent_observation_id | No | Optional parent observation ID filter (exact match) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |