Skip to main content
Glama

react-profiler-start

Starts a Hermes CPU and React commit profiling session for a selected iOS/Android device, then returns session metadata so you can perform the interaction and stop recording.

Instructions

Record Hermes CPU samples and React commits during an interaction. On an iOS simulator, Android device, call native-profiler-start in parallel on the same target for a combined report, unless the user declines native profiling. After starting, ask the user to perform the interaction to profile, then call react-profiler-stop. Returns { started_at, startedAtEpochMs, hermes_version, detected_architecture }. On iOS and Android, a warning names the apps with native network capture on (started by network-capture-start): their timings in the profile can differ. If a session is already running, returns { already_running: true, mine, owner, … } instead, without clobbering its data, unless it is another tool-server's stale run, has no owner record, or is a lost run of this tool-server: start replaces those. mine: true means this tool-server started the run: if it is yours, call react-profiler-stop. With stale: true it may be another agent's: follow the note. Otherwise, BEFORE OVERTAKING with { force: true }, ask the user for approval first, as how_to_reclaim explains. A start that replaces a run reports it in took_over. Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot be established.

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": {
      "device_id": "<device_id>"
    },
    "name": "react-profiler-start"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNoMetro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. Range: 1 to 65535.
forceNoTake over an active profiling session even when it is owned by another tool-server and still fresh. Set to true only when you know the prior owner is gone. Default: false.
device_idYesDevice ID from list-devices. For iOS or Android on a shared Metro, use the target's logicalDeviceId if asked to disambiguate.
sample_interval_usNoCPU sampling interval in microseconds. Default: 100. Must be greater than 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / device_id / description
      Previous value: -"Device id from list-devices — the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."New value: +"Device ID from list-devices. For iOS or Android on a shared Metro, use the target's logicalDeviceId if asked to disambiguate."
    • changedInput schema / properties / force / description
      Previous value: -"Take over an active profiling session even when it is owned by another tool-server and still fresh. Set to true only when you know the prior owner is gone."New value: +"Take over an active profiling session even when it is owned by another tool-server and still fresh. Set to true only when you know the prior owner is gone. Default: false."
    • changedInput schema / properties / port / description
      Previous value: -"Metro server port. Optional — omit it to use this device's port, 8081 by default. Ignored for Chromium, whose CDP port is encoded in device_id."New value: +"Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. Range: 1 to 65535."
    • changedInput schema / properties / sample_interval_us / description
      Previous value: -"CPU sampling interval in microseconds (default 100)"New value: +"CPU sampling interval in microseconds. Default: 100. Must be greater than 0."
    • removedInput schema / properties / sample_interval_us / maximum
      Removed value: -9007199254740991
  2. Changed5 schema fields changedv0.25.0
    • removedInput schema / properties / port / default
      Removed value: -8081
    • changedInput schema / properties / port / description
      Previous value: -"Metro server port"New value: +"Metro server port. Optional — omit it to use this device's port, 8081 by default. Ignored for Chromium, whose CDP port is encoded in device_id."
    • addedInput schema / properties / port / maximum
      Added value: +65535
    • addedInput schema / properties / port / minimum
      Added value: +1
    • changedInput schema / properties / port / type
      Previous value: -"number"New value: +"integer"
  3. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / device_id / description
      Previous value: -"Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."New value: +"Device id from list-devices — the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
  4. First observedv0.15.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses that an active session is not clobbered, enumerates the already_running response shape (mine, owner, stale), defines mine: true, explains which runs are replaced versus protected, reports takeovers via took_over, warns about native network capture skewing timings, and names the two failure conditions (Hermes runtime unreachable, Metro CDP connection failure).

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?

Front-loaded with the core action, the parallel-tool recommendation, and the follow-up call before any edge-case handling. The already_running paragraph is dense and multi-clause, and 'mine: true means this tool-server started the run: if it is yours, call react-profiler-stop' is slightly tangled, but every sentence carries operational information rather than filler.

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?

There is no output schema, so the description must explain return values and it does: the started_at/startedAtEpochMs/hermes_version/detected_architecture payload, the alternate already_running payload, and the took_over field. For a stateful session-starting tool with concurrency hazards, this covers what an agent needs before calling, during a conflict, and after success.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema for force: it mandates asking the user for approval before overtaking and points to how_to_reclaim, which the schema's own 'set to true only when you know the prior owner is gone' does not convey. Port, device_id, and sample_interval_us are left entirely to the schema.

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 dual resource set: 'Record Hermes CPU samples and React commits during an interaction.' It immediately distinguishes itself from the sibling native-profiler-start by framing that tool as a complementary parallel call on the same target, so an agent can place this tool relative to its neighbor without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit sequencing (start here, ask the user to perform the interaction, then call react-profiler-stop), an explicit parallel-call recommendation with a conditional escape ('unless the user declines native profiling'), and an explicit approval gate before using force. When-to-use, what-to-do-next, and when-not-to-overtake are all spelled out.

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