fetch_traces
Search Langfuse traces using optional filters like age, name, tags, user ID, session, and metadata. Retrieve paginated results to debug LLM applications or analyze trace history.
Instructions
Find traces based on filters. All filter parameters are optional.
On Observations API v2, each trace is built from its root observation; traces without a root observation do not appear.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| age | Yes | Minutes ago to start looking (e.g., 1440 for 24 hours) | |
| name | No | Name of the trace to filter by | |
| page | No | Page number for pagination (starts at 1) | |
| tags | No | Tag or comma-separated list of tags to filter traces by | |
| limit | No | Maximum number of traces to return per page | |
| user_id | No | User ID to filter traces by | |
| metadata | No | Metadata fields to filter by | |
| session_id | No | Session ID to filter traces by | |
| output_mode | No | Controls the output format: 'compact' (default) returns summarized JSON, 'full_json_string' returns complete raw JSON as string, 'full_json_file' saves complete data to file and returns summary with path. | compact |
| include_observations | No | If True, fetch and include the full observation objects instead of just IDs. Use this when you need access to system prompts, model parameters, or other details stored within observations. Significantly increases response time but provides complete data. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |