Skip to main content
Glama

Measure performance

measure_performance

Measure iOS and Android app performance across launch time, scrolling jank, memory leaks, slow frames, and CPU hotspots, returning metrics and traces for diagnosis.

Instructions

Measure performance by metric. launch: startup time, cold, warm or hot, over repeats; trace: why. scroll: jank and frozen frames of a list (x,y or selector). heap: memory leaks, the heap to a file. frames: why frames were slow, hitches, hangs (what). cpu: top functions over seconds. snapshot: CPU, memory, frames, load and heat now (also). Returns numbers, findings, a trace's path; scenario keeps the run for compare_performance.

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": {
      "metric": "<metric>"
    },
    "name": "measure_performance"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
appNo
alsoNoenergy (says if a model); anonMemory: by process state, bitmaps; surface: a SurfaceView or game; startInfo: why it last started; battery: wake locks, wakeups, jobs
dsymNothe build's .dSYM or a folder of them
modeNocold
whatNoframes
probeNo
traceNo
metricYes
swipesNo
compileNo
profileNo
repeatsNo
secondsNo
baselineNo3 runs, added to compare_performance's baseline
scenarioNo
selectorNo
directionNoframes, cpu: scroll meanwhile
cpuWindowMsNo
baselineProfileNoAndroid, a release build: in the APK, applied, cold starts with and without
batteryWindowMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.4

TDQS

A3.5/5.0
Behavior3/5

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

With only openWorldHint=false supplied, the description must carry the behavioral load. It does disclose real side effects that annotations do not: heap writes to a file, baseline adds three runs to compare_performance's baseline, and scenario retains a run for later comparison. It omits runtime cost/duration characteristics, build or platform prerequisites (beyond one note that baselineProfile needs a release APK), and whether runs block, which matters for a 22-parameter measurement tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is compact and front-loads the purpose, and every phrase carries information, but the telegraphic fragments ('trace: why', '(what)', '(also)') sacrifice readability and force the agent to decode param-name parentheticals. A slightly longer, structured per-metric list would cost few tokens and gain much clarity.

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 tool with 22 parameters, a nested selector object, no output schema, and near-empty annotations, the description covers the metric taxonomy and return shape but leaves large gaps: which parameters apply to which metric, platform/build requirements, and expected run duration. Adequate to start a call, not adequate to call it correctly on the first attempt.

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?

Description adds meaning for a subset of parameters by mapping them to modes: x/y or selector for scroll, what for frames, repeats for launch, also for snapshot, and the return of a trace's path. With 22 parameters and only ~23% schema description coverage, many inputs (swipes, compile, profile, probe, seconds, cpuWindowMs, batteryWindowMs, app) remain unexplained in both places, and the cryptic '(what)' and '(also)' hints require guessing that they refer to parameter names.

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 first clause names a specific verb and resource ('Measure performance by metric') and then enumerates the six metric modes (launch, scroll, heap, frames, cpu, snapshot), so an agent knows exactly what capability this covers. It also links to the sibling compare_performance via the 'scenario' note, giving partial sibling differentiation, though other siblings like read_logs or capture_network are never contrasted.

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?

Each metric is annotated with the question it answers ('heap: memory leaks', 'scroll: jank and frozen frames', 'cpu: top functions over seconds'), which effectively tells an agent which mode to select for a given diagnostic goal. There are no explicit exclusions or when-not-to-use statements, and nothing says when to prefer snapshot over running several targeted metrics.

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