Querytraceevents
queryTraceEventsQuery raw trace events from engineering data sources.
Returns individual event records (pull requests, deployments, CI runs, etc.) with flexible filtering, ordering, and pagination. Time range (startDate/endDate) cannot exceed 6 months (180 days). Maximum 5000 results per request.
PREREQUISITES - Follow this workflow:
Discover available sources and attributes: Call listMetricDefinitions (view='full') to see available data sources
Use source names and attribute keys from the registry response to construct your trace query
Do NOT guess attribute names - always use exact values from listMetricDefinitions responses
IMPORTANT: Use exact attribute names from the registry. Filters use the same AttributeFilter format as the metrics API.
LINKING: Most sources have a URL attribute (e.g., 'pull_requests.url', 'deployments.url'). Always include URL attributes in your query so you can hyperlink results in Slack using <URL|display text> format.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | Maximum number of results to return (max 500) | |
| source | Yes | Data source to query (e.g., 'pull_requests', 'deployments') | |
| context | Yes | Explain why you're invoking this tool now and how its output will be used. Then state how this call supports your *overall objective* and fits into your broader plan across all tool calls (e.g., why this tool vs. others, and what step it unblocks). Never share any personal details or sensitive information. | |
| endDate | Yes | End of the time range to query | |
| filters | Yes | Filters to apply to the query | |
| orderBy | Yes | Ordering specification for results | |
| nextPage | No | Pagination cursor from a previous response | |
| startDate | Yes | Start of the time range to query | |
| attributes | Yes | List of attribute names to include in results. Empty returns all attributes. | |
| daysOfWeek | No | Optional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, only events whose time attribute falls on one of these days are returned (e.g. [1,2,3,4,5] excludes weekends). | |
| session_id | Yes | Session continuity handle, one of two values: the ses_ ID issued for the task underway, or start. This server cannot link your calls between requests on its own, so session continuity travels in this parameter instead. If you were handed a session_id for this task — for example by the agent that spawned you — send that exact value from your first call. Otherwise send start on your first call; the server will issue an opaque correlation ID in the mcp_session field of the result, or in a text block at the start of the result beginning [session_id issued. Then send that exact ses_ value on every later call and hand it to any subagents working the same task. start always begins a new, unrelated task — never send it mid-task. If you send a value this server does not recognize, the result reports it: mcp_session.status of unrecognized, or a text block beginning [session_id unrecognized; re-send the ID issued for this task, or start if none was issued yet. Never invent a ses_ value. | |
| timeAttribute | No | Override the default time attribute for time-based filtering |