list_traces
List and filter workflow execution traces via server-side filtering, sorting, and pagination. Target traces by error count, cost, customer, or metadata without fetching all data.
Instructions
List and filter traces with sorting, pagination, and server-side filtering.
A trace represents a complete workflow execution containing multiple spans (individual operations).
IMPORTANT: Use the "filters" parameter to filter results server-side. Do NOT fetch all traces and filter client-side.
PARAMETERS:
page_size: Results per page (1-20, default 10)
page: Page number (default 1)
sort_by: Sort field with optional - prefix for descending (e.g. "-total_cost", "duration")
start_time / end_time: ISO 8601 time range (default: last 1 hour)
environment: Filter by environment (e.g. "production", "test")
filters: Array of server-side filter objects. Each filter has: field (string), operator (string), value (array). See below.
FILTERS - supported operators: "" (exact match), "not", "lt", "lte", "gt", "gte", "icontains", "startswith", "endswith", "in", "isnull"
FILTERS - supported fields: trace_unique_id, customer_identifier, environment, span_count, llm_call_count, error_count, total_cost, total_tokens, total_prompt_tokens, total_completion_tokens, duration, workflow_name (span_workflow_name), metadata__
EXAMPLE - find traces with errors: { "filters": [{"field": "error_count", "operator": "gt", "value": [0]}], "sort_by": "-total_cost" }
EXAMPLE - find traces for a specific customer: { "filters": [ {"field": "customer_identifier", "operator": "", "value": ["user@example.com"]}, {"field": "total_cost", "operator": "gte", "value": [0.01]} ] }
RESPONSE FIELDS:
trace_unique_id: Unique identifier
start_time, end_time: Trace time range
duration: Total duration in seconds
span_count: Number of spans
llm_call_count: Number of LLM API calls
total_prompt_tokens, total_completion_tokens, total_tokens: Token usage
total_cost: Cost in USD
error_count: Number of errors
input, output: Root span's input/output
metadata: Custom metadata
customer_identifier: User identifier
environment: Environment name
trace_group_identifier: Workflow group
name: Root span name
model: Primary model used
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (default 1) | |
| filters | No | Array of server-side filters. Each filter has field, operator, and value. Example: [{"field": "error_count", "operator": "gt", "value": [0]}] | |
| sort_by | No | Sort field. Prefix with - for descending order. | |
| end_time | No | End time in ISO 8601 format. Default: current time | |
| page_size | No | Results per page (1-20, default 10) | |
| start_time | No | Start time in ISO 8601 format. Default: 1 hour ago | |
| environment | No | Filter by environment (e.g., 'production', 'test') |