Skip to main content
Glama

Query Distributed Traces

query_traces
Read-onlyIdempotent

Search distributed traces (Tempo TraceQL), newest first, to find slow, failing, or specific requests; drill into one with get_trace. Filter with structured params (gvc, workload, location, httpMethod, requestId, errorsOnly, minDuration) OR a raw traceql query, which REPLACES them and must embed every filter. Span attributes: resource.gvc, resource.workload, resource.location, span.http.method, span.http.url (the full URL), span.http.status_code (a string, e.g. "503"), span."guid:x-request-id". Traces exist only where tracing is enabled (spec.tracing on the GVC via update_gvc, or on the org) and only for requests sampled after that. Returns trace IDs with root span, requests seen, start time, and duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoAbsolute end time (exclusive, ISO 8601).
gvcNoFilter traces to one GVC (matches the `resource.gvc` span attribute).
orgNoOrganization slug.
fromNoAbsolute start time (inclusive, ISO 8601). Overrides `since`. Must be earlier than `to`.
limitNoMaximum traces to return (default: 20, max: 100).
sinceNoLookback window as relative duration (default: "1h"). Examples: "30m", "2h", "1d".
traceqlNoRaw TraceQL, e.g. `{ resource.gvc = "prod" && span.http.url =~ ".*/checkout.*" }`. REPLACES the structured params, so it must embed every filter.
locationNoFilter traces to one location (e.g., "aws-us-east-1").
workloadNoFilter traces to one workload (matches the `resource.workload` span attribute).
requestIdNoOnly the trace of this request: the x-request-id in access and request logs.
errorsOnlyNoOnly return traces containing at least one error span.
httpMethodNoOnly traces with a request of this HTTP method, e.g. "POST".
minDurationNoOnly return traces slower than this total duration (e.g., "500ms", "2s") — the slow-request finder.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / from / maxLength
      Removed value: -40
    • removedInput schema / properties / gvc / minLength
      Removed value: -1
    • addedInput schema / properties / httpMethod
      Added value: +{
      +  "description": "Only traces with a request of this HTTP method, e.g. \"POST\".",
      +  "type": "string"
      +}
    • removedInput schema / properties / location / minLength
      Removed value: -1
    • removedInput schema / properties / minDuration / pattern
      Removed value: -"^\\d+(\\.\\d+)?(ns|us|ms|s|m|h)$"
    • changedInput schema / properties / org / description
      Previous value: -"Organization slug (lowercase kebab-case). NEVER guess — if the user has not named one, ask. On org-not-found, stop and ask; do not retry variants."New value: +"Organization slug."
    • removedInput schema / properties / org / maxLength
      Removed value: -63
    • removedInput schema / properties / org / minLength
      Removed value: -1
    • removedInput schema / properties / org / pattern
      Removed value: -"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"
    • addedInput schema / properties / requestId
      Added value: +{
      +  "description": "Only the trace of this request: the x-request-id in access and request logs.",
      +  "type": "string"
      +}
    • removedInput schema / properties / since / maxLength
      Removed value: -20
    • removedInput schema / properties / to / maxLength
      Removed value: -40
    • changedInput schema / properties / traceql / description
      Previous value: -"Raw TraceQL query (e.g. `{ resource.workload = \"api\" && status = error }`). REPLACES the structured params entirely, so it must embed ALL filters itself. Span attributes available: resource.gvc, resource.workload, resource.location."New value: +"Raw TraceQL, e.g. `{ resource.gvc = \"prod\" && span.http.url =~ \".*/checkout.*\" }`. REPLACES the structured params, so it must embed every filter."
    • removedInput schema / properties / traceql / maxLength
      Removed value: -500
    • removedInput schema / properties / traceql / minLength
      Removed value: -1
    • removedInput schema / properties / workload / minLength
      Removed value: -1
    • removedInput schema / required
      Removed value: -[
      -  "org"
      -]
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / data / description
      Previous value: -"The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary."New value: +"The full result. Read this, not only the summary."
    • addedOutput schema / properties / details
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / nextSteps / description
      Removed value: -"Recommended follow-up actions for this task, in order."
    • removedOutput schema / properties / ok / description
      Removed value: -"Whether the call succeeded."
    • removedOutput schema / properties / summary / description
      Removed value: -"One-line summary of the result."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/non-destructive annotations, it discloses real behavioral traits: newest-first ordering, the mutually exclusive traceql-vs-structured filter mode, and critically the enablement/sampling caveat that explains why results may be empty. This is exactly the kind of context annotations cannot carry.

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?

Purpose and the get_trace handoff are front-loaded, and the sentences are dense but informative. The trailing 'Returns trace IDs with root span, requests seen, start time, and duration' duplicates the output schema, which is minor waste but keeps it from a perfect score.

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

Completeness5/5

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

For a 13-parameter tool with two query modes and an enablement dependency, the description covers ordering, mode interaction, filterable attributes, and the tracing prerequisite. With an output schema present, it needn't detail return values further, and nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes further by mapping filterable span attributes (resource.gvc, span.http.url, span.http.status_code as a string e.g. "503", span."guid:x-request-id") that an agent needs to author TraceQL. Some of the traceql-override wording repeats the schema, but the attribute mapping is net-new 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?

States a specific verb and resource ('Search distributed traces (Tempo TraceQL)'), gives the default ordering ('newest first'), and explicitly routes to the sibling drill-down tool ('drill into one with get_trace'). An agent can distinguish it from get_trace without opening either schema.

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

Usage Guidelines5/5

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

Names the use cases ('find slow, failing, or specific requests'), points to the alternative for drilling deeper, and explains the enabling prerequisite ('Traces exist only where tracing is enabled ... and only for requests sampled after that'). It also clarifies when to prefer structured params versus a raw traceql query.

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.