Skip to main content
Glama

perf

Collects performance profiling artifacts and generates compact summaries for CPU, memory, and frame data to support performance analysis.

Instructions

Collect frame health, memory diagnostics, and platform profiling artifacts with compact agent-readable summaries. For CPU profiles, start and stop write the raw artifact while report writes a compact summary; request the report when the task needs readable native CPU evidence. Profiling output is evidence only: compact state, artifact path, and size. Times out after 90s.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outNoOutput artifact path.
areaYes
kindNo
udidNoApple device or simulator UDID; the selector that pins one device when several share a name.
debugNoEnable debug diagnostics.
runIdNoLease run identifier.
actionNo
deviceNoDevice name selector (a UDID belongs in udid, a serial in serial).
serialNoAndroid, HarmonyOS, or Vega VVD serial selector.
targetNoAlias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element.
tenantNoRemote tenant identifier.
leaseIdNoExisting lease identifier.
sessionNoAgent-device session name.
subjectNo
noRecordNoDo not record this action.
platformNoPlatform selector used to resolve a device.
templateNoxctrace template name, for example Time Profiler.
tracePathNoExisting .trace path to report, defaults to the latest session trace.
includeCostNoInclude per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged.
deviceTargetNoDevice target form. Maps to the CLI --target flag.
responseLevelNoResponse verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged.
mcpOutputFormatNoMCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately.
androidDeviceAllowlistNoAndroid serial allowlist used for device resolution.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.21.0
    • changedInput schema / properties / device / description
      Previous value: -"Device name selector."New value: +"Device name selector (a UDID belongs in udid, a serial in serial)."
    • changedInput schema / properties / serial / description
      Previous value: -"Android device or Vega VVD serial selector."New value: +"Android, HarmonyOS, or Vega VVD serial selector."
    • changedInput schema / properties / udid / description
      Previous value: -"iOS device UDID selector."New value: +"Apple device or simulator UDID; the selector that pins one device when several share a name."
  2. Changed10 schema fields changedv0.20.10
    • changedInput schema / properties / area / enum
      Previous value: -[
      -  "metrics",
      -  "frames",
      -  "memory",
      -  "cpu",
      -  "trace"
      -]New value: +[
      +  "frames",
      +  "memory",
      +  "cpu",
      +  "trace"
      +]
    • removedInput schema / properties / cwd
      Removed value: -{
      -  "description": "Working directory for command execution.",
      -  "type": "string"
      -}
    • removedInput schema / properties / daemonAuthToken
      Removed value: -{
      -  "description": "Remote daemon auth token.",
      -  "type": "string"
      -}
    • removedInput schema / properties / daemonBaseUrl
      Removed value: -{
      -  "description": "Remote daemon base URL.",
      -  "type": "string"
      -}
    • removedInput schema / properties / iosSimulatorDeviceSet
      Removed value: -{
      -  "description": "iOS simulator device-set path used for device resolution.",
      -  "type": "string"
      -}
    • removedInput schema / properties / iosXctestDerivedDataPath
      Removed value: -{
      -  "description": "Derived data path for external iOS XCTest runner execution.",
      -  "type": "string"
      -}
    • removedInput schema / properties / iosXctestEnvDir
      Removed value: -{
      -  "description": "Writable directory for iOS XCTest runner env overlays.",
      -  "type": "string"
      -}
    • removedInput schema / properties / iosXctestrunFile
      Removed value: -{
      -  "description": "Externally built iOS XCTest runner .xctestrun artifact path.",
      -  "type": "string"
      -}
    • removedInput schema / properties / stateDir
      Removed value: -{
      -  "description": "Agent-device state directory.",
      -  "type": "string"
      -}
    • addedInput schema / required
      Added value: +[
      +  "area"
      +]
  3. Changed1 schema field changedv0.20.9
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "apple",
      -  "android",
      -  "vega",
      -  "linux",
      -  "web",
      -  "ios",
      -  "macos"
      -]New value: +[
      +  "apple",
      +  "android",
      +  "harmonyos",
      +  "vega",
      +  "linux",
      +  "web",
      +  "ios",
      +  "macos"
      +]
  4. Changed3 schema fields changedv0.20.2
    • addedInput schema / properties / noRecord
      Added value: +{
      +  "description": "Do not record this action.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "apple",
      -  "android",
      -  "linux",
      -  "web",
      -  "ios",
      -  "macos"
      -]New value: +[
      +  "apple",
      +  "android",
      +  "vega",
      +  "linux",
      +  "web",
      +  "ios",
      +  "macos"
      +]
    • changedInput schema / properties / serial / description
      Previous value: -"Android serial selector."New value: +"Android device or Vega VVD serial selector."
  5. Changed3 schema fields changedv0.17.11
    • addedInput schema / properties / includeCost
      Added value: +{
      +  "description": "Include per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "ios",
      -  "macos",
      -  "android",
      -  "linux",
      -  "web",
      -  "apple"
      -]New value: +[
      +  "apple",
      +  "android",
      +  "linux",
      +  "web",
      +  "ios",
      +  "macos"
      +]
    • addedInput schema / properties / responseLevel
      Added value: +{
      +  "description": "Response verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged.",
      +  "enum": [
      +    "digest",
      +    "default",
      +    "full"
      +  ],
      +  "type": "string"
      +}
  6. Changed1 schema field changedv0.17.7
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "ios",
      -  "macos",
      -  "android",
      -  "linux",
      -  "apple"
      -]New value: +[
      +  "ios",
      +  "macos",
      +  "android",
      +  "linux",
      +  "web",
      +  "apple"
      +]
  7. Changed12 schema fields changedv0.17.6
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "sample"
      -]New value: +[
      +  "sample",
      +  "snapshot",
      +  "start",
      +  "stop",
      +  "report"
      +]
    • changedInput schema / properties / area / enum
      Previous value: -[
      -  "metrics",
      -  "frames"
      -]New value: +[
      +  "metrics",
      +  "frames",
      +  "memory",
      +  "cpu",
      +  "trace"
      +]
    • addedInput schema / properties / iosXctestDerivedDataPath
      Added value: +{
      +  "description": "Derived data path for external iOS XCTest runner execution.",
      +  "type": "string"
      +}
    • addedInput schema / properties / iosXctestEnvDir
      Added value: +{
      +  "description": "Writable directory for iOS XCTest runner env overlays.",
      +  "type": "string"
      +}
    • addedInput schema / properties / iosXctestrunFile
      Added value: +{
      +  "description": "Externally built iOS XCTest runner .xctestrun artifact path.",
      +  "type": "string"
      +}
    • addedInput schema / properties / kind
      Added value: +{
      +  "enum": [
      +    "xctrace",
      +    "simpleperf",
      +    "perfetto",
      +    "android-hprof",
      +    "memgraph"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / mcpOutputFormat
      Added value: +{
      +  "description": "MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately.",
      +  "enum": [
      +    "optimized",
      +    "json"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / out
      Added value: +{
      +  "description": "Output artifact path.",
      +  "type": "string"
      +}
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "ios",
      -  "android",
      -  "macos",
      -  "linux",
      -  "apple"
      -]New value: +[
      +  "ios",
      +  "macos",
      +  "android",
      +  "linux",
      +  "apple"
      +]
    • addedInput schema / properties / subject
      Added value: +{
      +  "enum": [
      +    "profile"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / template
      Added value: +{
      +  "description": "xctrace template name, for example Time Profiler.",
      +  "type": "string"
      +}
    • addedInput schema / properties / tracePath
      Added value: +{
      +  "description": "Existing .trace path to report, defaults to the latest session trace.",
      +  "type": "string"
      +}
  8. Changed2 schema fields changedv0.17.1
    • addedInput schema / properties / action
      Added value: +{
      +  "enum": [
      +    "sample"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / area
      Added value: +{
      +  "enum": [
      +    "metrics",
      +    "frames"
      +  ],
      +  "type": "string"
      +}
  9. First observedv0.16.9

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the 90-second timeout, describes the output as 'evidence only' with 'compact state, artifact path, and size', and clarifies the behavior of start/stop vs report for CPU profiles. This goes beyond a minimal description, though it does not address side effects, permissions, or error conditions.

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?

The description is three sentences, front-loaded with the primary purpose, then adding action-specific guidance and a timeout note. Every sentence contributes distinct information with no waste. It is compact and well-structured for an agent to parse quickly.

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?

Given the tool's complexity (23 parameters) and no output schema, the description covers the essential behavior: what it collects, the distinction between raw and summary artifacts, output shape, and the timeout. It relies on the schema for parameter details, which is reasonable given 83% coverage. It does not mention error handling or edge cases, but the information provided is sufficient for an agent to call it correctly in common cases.

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 83%, so the schema already documents most parameters. The description adds value by explaining the action semantics (e.g., start/stop vs report behavior), which informs how parameters like 'action' and 'kind' are used. However, it does not elaborate on the many selector parameters (udid, serial, device), relying on the schema's existing descriptions. This is adequate given high coverage.

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 clearly states the tool's purpose: 'Collect frame health, memory diagnostics, and platform profiling artifacts with compact agent-readable summaries.' It specifies the resource (profiling artifacts) and the action (collect). It distinguishes actions within the tool (start/stop vs report) but does not explicitly contrast with sibling tools like 'trace', so it stops short of full differentiation.

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 description provides some guidance on when to use the 'report' action ('request the report when the task needs readable native CPU evidence') and notes that start/stop write raw artifacts. However, it does not compare this tool to alternatives or state when to prefer 'perf' over a sibling like 'trace' or 'artifacts'. The guidance is limited to internal action selection, not tool selection.

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