Skip to main content
Glama

Querytraceevents

queryTraceEvents

Query 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:

  1. Discover available sources and attributes: Call listMetricDefinitions (view='full') to see available data sources

  2. Use source names and attribute keys from the registry response to construct your trace query

  3. 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

TableJSON Schema
NameRequiredDescriptionDefault
limitYesMaximum number of results to return (max 500)
sourceYesData source to query (e.g., 'pull_requests', 'deployments')
contextYes 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.
endDateYesEnd of the time range to query
filtersYesFilters to apply to the query
orderByYesOrdering specification for results
nextPageNoPagination cursor from a previous response
startDateYesStart of the time range to query
attributesYesList of attribute names to include in results. Empty returns all attributes.
daysOfWeekNoOptional 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_idYesSession 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.
timeAttributeNoOverride the default time attribute for time-based filtering

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full transparency burden. It usefully discloses the 180-day time-range cap, the 5000-result maximum, the need for registry-exact attribute names, and the Slack linking expectation. However, the stated 'Maximum 5000 results per request' conflicts with the schema's limit description of 'max 500', making the behavioral guidance inconsistent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with bolded PREREQUISITES, IMPORTANT, and LINKING sections, and it front-loads the core purpose and constraints. There is some redundancy around using exact attribute names from the registry, repeated in both step 3 and the IMPORTANT section, but overall it is scannable and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is strong on prerequisites and constraints, but there is no output schema and the description does not explain the response envelope or pagination mechanics beyond saying individual records are returned. For a 12-parameter tool with no annotations, the return structure and pagination behavior should be more explicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema describes all 12 parameters, so the baseline is 3 even without extra description. The description adds useful context about the 6-month range, exact attribute names, and URL attributes, but its 'Maximum 5000 results per request' directly contradicts the schema's limit 'max 500', which is actively misleading for an agent selecting a limit value.

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 the tool 'Query raw trace events from engineering data sources' and says it returns individual event records such as pull requests, deployments, and CI runs. This distinguishes it from sibling tools like queryPointInTimeMetrics by contrasting raw event records with point-in-time metric data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a concrete workflow: call listMetricDefinitions first, use exact source and attribute names from the registry, and include URL attributes for Slack hyperlinks. It does not explicitly say when to prefer this tool over queryPointInTimeMetrics or other alternatives, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources