Skip to main content
Glama

react-profiler-stop

Stop CPU profiling to capture the React commit tree and cpuProfile, then analyze rendering performance and unattributed fiber work.

Instructions

Stop CPU profiling and collect the cpuProfile + React commit tree. Reads commit data from the in-app React DevTools backend. Stores results in the ReactProfilerSession for later use by react-profiler-analyze or react-profiler-cpu-summary. Call react-profiler-start first, then exercise the app, then call this. Returns { duration_ms, sample_count, fiber_renders_captured, total_react_commits, hot_commit_indices } summarizing the session. When any commit had fibers whose display name could not be resolved at stop time (typically transient components like modals/tooltips/animations that unmounted before stop), the response also includes { unattributed_ms, unattributed_fiber_count, unattributed_commit_count } — these quantify how much work is not accounted for in the per-component breakdown (the per-commit duration itself remains correct). Fails if no active profiling session exists or the CDP connection was lost during recording.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoMetro 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.
device_idYesDevice id from list-devices — the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial).

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
  2. 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)."
  3. First observedv0.15.0

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It comprehensively discloses behavior: reads commit data from the backend, stores results in a session for later use, returns specific summary fields, includes additional unattributed fields when needed, and fails under certain conditions. It does not explicitly state that it is a stopping action that ends the profiling session, but this is implied by 'stop'.

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 dense but well organized. It front-loads the primary action, then explains the sequence, the return value, and edge-case behavior. Every sentence adds value, and it avoids redundancy with the schema. Despite length, it remains focused and structured for quick comprehension.

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?

The tool is moderately complex with side effects (stops profiling, stores data), but the description covers the workflow, inputs, outputs, and failure modes. The output schema is absent, but the description explains the return fields explicitly. Sibling context is provided via usage guidance. No critical information is missing for an agent to invoke it correctly.

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% and the schema descriptions are already detailed (e.g., 'Metro server port. Optional...' and 'Device id from list-devices...'). The description adds operational context linking device_id to debugger-connect, which is useful but not entirely new. The port parameter is well documented in the schema, and the description reinforces its optionality and default behavior.

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?

The description clearly states the tool's purpose: 'Stop CPU profiling and collect the cpuProfile + React commit tree.' It specifies the verb (stop), the resource (CPU profiling), and the data collected. It distinguishes itself from siblings like react-profiler-start and react-profiler-analyze, clearly indicating it is the stop-and-collect step in a sequence.

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?

The description explicitly instructs the correct sequence: 'Call react-profiler-start first, then exercise the app, then call this.' This is rare and highly valuable. It also names alternative tools that consume the results (react-profiler-analyze, react-profiler-cpu-summary), providing context for when this tool is used versus those. It mentions failure conditions (no active session, lost CDP connection), clarifying when not to call it.

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