Skip to main content
Glama

perf_attach

Record an already-running program by PID or command-line name for a set duration and return GPU trace summaries while leaving the program running; launch games via their launcher first.

Instructions

Records a program that is already running, by pid or by a name in its command line (Game.exe under Wine), for seconds and returns the same summary as perf_record; the program keeps running. For games started by Steam, CrossOver, NotProton or any launcher: start the game or its benchmark there first.

Input Schema

NameRequiredDescriptionDefault
labelYesname for the run: letters, digits, '.', '_', '-'
processYespid, or a name in the program's command line such as Game.exe
secondsNorecording length, default 20; the export afterwards takes several minutes under Wine

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.1
    • changedInput schema / properties / seconds / description
      Previous value: -"recording length, default 20; the export afterwards takes about a minute"New value: +"recording length, default 20; the export afterwards takes several minutes under Wine"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  2. Addedv0.7.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and non-idempotent, so the safety profile is covered. The description adds genuinely new behavior: the target keeps running afterwards, the result matches perf_record's summary, and the post-run export takes minutes under Wine. It omits failure modes such as what happens when the pid/name is not found.

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 sentences, front-loaded with the core behavior and scope, then the launcher caveat. Slightly run-on across line breaks but no filler sentences.

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?

Output schema exists and the description references it by equivalence ('same summary as perf_record'), so return values need no explanation. Given a non-destructive attach tool with full schema coverage, only error/not-found behavior and permission needs are missing.

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%, so all three parameters are already documented, including the default of 20 for `seconds`. The description's 'Game.exe under Wine' example reinforces the `process` semantics but does not add syntax or matching rules beyond what the schema states.

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 ('Records a program that is already running') and adds the scope constraint 'by pid or by a name in its command line', which cleanly separates it from perf_record, the sibling that presumably launches its own target. An agent can tell the two apart without opening a schema.

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

Usage Guidelines4/5

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

Explicitly says when to use it: for programs that are already running, and for games launched by Steam/CrossOver/NotProton where the agent must start the game in the launcher first. It stops short of naming perf_record as the alternative for not-yet-running programs, leaving that inference to the reader.

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