Skip to main content
Glama

trace

Records Perfetto system activity for a set duration and saves the file on the host, optionally capturing app-defined sections or a cold-start launch for performance analysis.

Instructions

Records a Perfetto system trace (scheduling, frames, binder, app trace sections) for duration_s and saves it on the host. With package, the app's own Trace sections are recorded; with launch, the app is force-stopped and launched a second into the trace to capture a cold start. Open the file at https://ui.perfetto.dev.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
launchNo
packageNo
buffer_mbNo
categoriesNoatrace categories. Default: sched freq idle gfx view wm am input binder_driver dalvik hal res.
duration_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that launch force-stops and relaunches the app, and that the trace is saved on the host, but it omits permissions, file location, overwrite behavior, and what is returned.

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 description is front-loaded and efficient: it starts with what is recorded, then explains the two modes, then points to the Perfetto UI. There is little wasted wording, though it could be slightly tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter tool with no annotations and no output schema, the description covers the main behavior and mode distinctions. It is still incomplete regarding output location, permissions, buffer behavior, and how the saved file is identified.

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 only 20%, so the description must add meaning. It explains package and launch semantics and ties duration_s to recording time, but it says nothing about buffer_mb and adds little beyond the schema for categories.

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 states a specific verb and resource: it records a Perfetto system trace covering scheduling, frames, binder, and app trace sections, and saves it on the host. It also clarifies the package and launch modes. It does not explicitly differentiate itself from nearby tools such as app_perf or record_screen.

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 explains what happens when package or launch is supplied, which implies when those modes are useful. However, it gives no explicit guidance on when to choose this tool over siblings like app_perf, logcat, or record_screen, and no exclusions are stated.

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