Skip to main content
Glama

perf_diagnose

Read-only

Diagnoses GPU encoder fragmentation in saved recordings, reporting short-encoder share, encoders and command buffers per frame, GPU idle time, and translation-layer patterns to reveal overhead.

Instructions

Says whether a saved recording splits its GPU work into too many short encoders, the pattern of translation layers such as DXMT, Mullion or MoltenVK, with the numbers behind it: encoders and command buffers per frame, the share of short encoders, the labels with the most GPU time and the GPU's idle time. Read the idle time together with the FPS: a program waiting for vsync idles too. Defaults come from bgfx 17-drawstress on an M1 Pro: 7 encoders per frame and 50% under 25 us under Mullion, 2 and 2% in native Metal.

Input Schema

NameRequiredDescriptionDefault
runYesa run name from perf_runs
short_usNoan encoder under this GPU time counts as short: 10, 25 (default), 50, 100, 250, 500 or 1000
short_shareNoshare of short encoders from which the verdict is yes, default 0.25
min_encodersNoencoders per frame (median) from which the verdict can be yes, default 4

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  2. Addedv0.7.1

TDQS

A3.8/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 genuine context by disclosing the verdict's decision basis (short-encoder share, encoders per frame), reference values from bgfx 17-drawstress on an M1 Pro under Mullion vs native Metal, and an important interpretation caveat that idle time must be read alongside FPS because a vsync-bound program also idles.

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 verdict and evidence list are front-loaded in the first sentence, with the interpretation caveat and the reference numbers following. It is dense but every sentence carries decision-relevant information; the M1 Pro benchmark sentence is long but functions as calibration rather than filler.

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 enumerate return values, and it correctly focuses on the decision logic, interpretation caveat and reference thresholds. For a four-parameter read-only diagnostic tool this is close to sufficient, missing only explicit routing versus sibling diagnostics.

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 baseline is 3, but the description earns extra credit by giving concrete calibration values (7 encoders/frame and 50% short under Mullion versus 2 and 2% in native Metal) that tell the agent what magnitudes of short_us, short_share and min_encoders are meaningful. It does not restate the per-parameter defaults that the schema already documents.

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?

The description opens with a specific verdict ('says whether a saved recording splits its GPU work into too many short encoders') plus the secondary axis it inspects (translation layers like DXMT/Mullion/MoltenVK) and the evidence it returns. An agent knows exactly what question this tool answers. It stops short of naming a sibling (e.g. perf_compare or perf_check) to draw the boundary explicitly.

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?

Usage is implied: the tool takes a run name from perf_runs, so it operates on already-recorded data, and the vsync/idle-time note tells the agent how to interpret results. But there is no explicit when-to-use versus perf_compare, perf_check or perf_baseline, nor any stated prerequisite beyond the run parameter.

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