Skip to main content
Glama

Diagnose encoder use

perf_diagnose
Read-only

Diagnose a saved GPU recording for excessive short encoders per frame, reporting encoder and command-buffer counts, short-encoder share, top GPU labels, idle time, and suggested next actions.

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: encoders and command buffers per frame, share of short encoders, labels with the most GPU time, idle time (read with the FPS: vsync idles too). suggested_actions says what to call next.

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": {
      "run": "<run>"
    },
    "name": "perf_diagnose"
  }
}

Input Schema

NameRequiredDescriptionDefault
runYesa run name from perf_runs
fieldsNoresult paths to keep, dotted: common.frame_pacing
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.28.0
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "result paths to keep, dotted: common.frame_pacing",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.10.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  3. 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 the safety profile is covered without prose. The description goes beyond them by enumerating what the analysis reports (encoders and command buffers per frame, short-encoder share, top GPU-time labels, idle time) and by flagging an interpretation caveat — idle time must be read alongside FPS because vsync produces legitimate 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?

Two dense sentences are front-loaded with the verdict question, then the supporting numbers, then the follow-up pointer. The parenthetical catalog of translation-layer names is slightly chatty but earns its place by helping an agent recognize the target scenario.

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?

Return values are covered by the output schema, safety by annotations, and parameters by a fully documented schema, so the description's remaining burden is scenario and interpretation — which it meets by describing the verdict, the evidence it reports, the vsync caveat, and the existence of `suggested_actions`. An agent has everything needed to call it correctly and read the result.

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%, including the accepted short_us values and the default thresholds, and an output schema exists, so the schema carries parameter meaning on its own. The description adds no parameter-level detail beyond implicitly tying the verdict to the run and its thresholds, which is the expected baseline when the schema is complete.

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 names a specific question the tool answers (does this recording split GPU work into too many short encoders) and even names the pattern's typical cause (translation layers like DXMT, Mullion, MoltenVK), so an agent knows exactly what verdict it gets. It falls short of 5 because it never differentiates itself from diagnostic siblings such as perf_check or perf_baseline — it only points forward via `suggested_actions`.

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 rather than stated: the tool takes a saved run from perf_runs and produces a verdict plus a `suggested_actions` field that tells the caller what to invoke next, which is a useful routing hint. There is no explicit when-not-to-use guidance and no named alternative for agents who want a general health check instead of an encoder-specific diagnosis.

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