Skip to main content
Glama

trace_query

Read-only

Queries a .trace table to return paged rows as {column: value}, optionally filtered to one process, enabling inspection of recorded GPU trace data.

Instructions

Returns one page of rows of one table of a .trace as {column: value}, optionally only one process's rows.

Input Schema

NameRequiredDescriptionDefault
pidNokeep only this process's rows
limitNorows per page, default 50, at most 500
traceYesa run name from perf_runs whose trace_kept is true, or the path of a .trace
offsetNofirst row, default 0
schemaYesa table name that trace_tables lists, such as metal-gpu-intervals

Output Schema

NameRequiredDescriptionDefault
rowsYes
totalYes
offsetYes
next_offsetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "next_offset": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "offset": {
      +      "type": "integer"
      +    },
      +    "rows": {
      +      "type": "array"
      +    },
      +    "total": {
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "total",
      +    "offset",
      +    "rows",
      +    "next_offset"
      +  ],
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv0.7.1
    • addedInput schema / properties / pid / description
      Added value: +"keep only this process's rows"
    • addedInput schema / properties / schema / description
      Added value: +"a table name that trace_tables lists, such as metal-gpu-intervals"
    • addedInput schema / properties / trace / description
      Added value: +"a run name from perf_runs whose trace_kept is true, or the path of a .trace"
  3. First observedv0.2.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds genuinely new behavior: results are paginated ('one page'), shaped as {column: value}, and can be scoped to a single process. It stops short of disclosing what happens with an invalid table name or an offset past the end of the data.

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

Conciseness5/5

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

A single front-loaded sentence with no filler; the core behavior (paged row read from one table of a trace) comes first and the optional pid narrowing follows. Nothing could be removed without losing information.

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

Completeness4/5

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

With an output schema present, the description need not explain return values, and all five parameters are documented in the schema. For a read-only paginated query tool the coverage is nearly complete; only error/edge-case behavior and the trace_tables dependency are unstated.

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

Parameters3/5

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

Schema description coverage is 100%, with limit defaults/maximum, offset default, pid filtering, and the trace_kept/table-name constraints all documented in the schema itself. The description only restates the pid filter ('optionally only one process's rows') and the paging concept, adding little beyond the structured fields, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: returns one page of rows from one table of a .trace, plus the return shape ({column: value}) and the optional pid narrowing. It implicitly separates itself from trace_tables (which lists tables) and trace_count (which counts), but never names those siblings, so an agent must infer the division of labor.

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

Usage Guidelines2/5

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

The description says what the tool returns but never states when to reach for it versus trace_tables, trace_count, or capture_records. There is no mention of the prerequisite that 'schema' must first come from trace_tables, and no guidance on paging strategy (e.g. advancing offset until a short page). Usage is only inferable from the wording.

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