Skip to main content
Glama

Count a trace's rows

trace_count
Read-only

Count table rows in a Metal GPU trace, overall and per process, to identify empty tables that need another instrument or Xcode rather than more pages.

Instructions

Counts the rows of tables of a recording, in all and per process: a table with 0 rows needs another instrument or Xcode, not a bigger page. Reads the .trace when kept, else the tables file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "trace": "<trace>"
    },
    "name": "trace_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
traceYesa run name from perf_runs with trace_kept or tables_kept true, or a .trace path
fieldsNoresult paths to keep, dotted: common.frame_pacing
tablesNotable names from trace_tables; default the tables that matter for a translation layer

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.28.0
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "result paths to keep, dotted: common.frame_pacing",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / trace / description
      Previous value: -"a run name from perf_runs whose trace_kept is true, or the path of a .trace"New value: +"a run name from perf_runs with trace_kept or tables_kept true, or a .trace path"
  2. Changed1 schema field changedv0.10.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  3. Addedv0.7.1

TDQS

A3.7/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 the safety profile is covered. The description adds genuine behavioral context beyond that: it discloses the data source resolution rule ('Reads the .trace when kept, else the tables file'), which tells the agent how the tool obtains its input and that behavior varies with what was retained. It does not mention failure modes or cost, keeping it below a 5.

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

Conciseness3/5

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

Purpose is front-loaded in the first clause, which is good. But 'in all and per process' is grammatically awkward and the embedded 'not a bigger page' aside is cryptic jargon that eats space without clear payoff for an uninitiated agent.

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?

An output schema exists, so return values need no explanation, and all three parameters are fully schema-documented. The description covers purpose, input resolution, and result interpretation, which is nearly everything an agent needs for a low-complexity read-only counting tool; only explicit sibling routing is absent.

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 schema already documents 'trace', 'fields' and 'tables'; the baseline would be 3. The description nevertheless adds real meaning to the 'trace' parameter by explaining the two backing stores (.trace vs tables file) that its 'trace_kept or tables_kept' acceptance implies, and clarifies the counting granularity that 'tables'/'fields' operate on.

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 ('Counts the rows of tables of a recording') plus the aggregation shape ('in all and per process'), so the agent knows it is a counting/summarization tool rather than a row-returning query. It does not name a sibling such as trace_query or trace_tables to sharpen the boundary, so it falls short of a 5.

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

Usage Guidelines3/5

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

The line 'a table with 0 rows needs another instrument or Xcode, not a bigger page' gives actionable interpretation guidance for the likely diagnostic use case. However, there is no explicit statement of when to pick this over trace_tables or trace_query, and no listed prerequisites or exclusions.

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