Skip to main content
Glama

react-profiler-cpu-summary

Investigate CPU hotspots unrelated to React rendering. After stopping the profiler, returns a table of top functions by self-time to pinpoint performance bottlenecks like regex or heavy computations.

Instructions

Return a raw Hermes CPU flamegraph summary (top hotspot functions by self-time). FOR DEDICATED CPU INVESTIGATION ONLY — do NOT call this as part of a normal profiling session. Use react-profiler-analyze instead; it covers all React rendering performance analysis. Use when you specifically need to investigate JS CPU hotspots that are NOT tied to React rendering (e.g. regex slowness, cryptography, heavy computations). Call react-profiler-stop first. Reads directly from the stored cpuProfile. Returns a markdown table of the top hotspot functions with self-time, total-time, and location. Fails if react-profiler-stop has not been called or no CPU profile is stored.

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.
top_nNoNumber of top hotspot functions to return (default 20)
device_idYesDevice logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId).
react_onlyNoIf true, only show React component functions (PascalCase names)

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. First observedv0.15.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations to supply safety or side-effect information, the description carries the full burden and does so well. It discloses that the tool reads from the stored cpuProfile, describes the output as a markdown table of top hotspot functions with specific columns, and states the failure conditions (react-profiler-stop not called or no stored profile).

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 purpose is front-loaded in the first sentence; the warning, alternative, use case, prerequisite, output format, and failure modes follow in tight, purposeful sentences. No sentence is redundant or purely administrative.

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?

Given four parameters, no output schema, and no annotations, the description covers the essential context an agent needs: when to call it, what to call first, what it reads, what it returns, and when it fails. The markdown table columns are even specified, which compensates for the absent output schema.

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 100%, so the schema already explains all four parameters, including defaults and Chromium port behavior. The description reinforces the top-N concept but does not add meaning beyond the schema, which fits the baseline for fully documented parameters.

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 opens with a clear verb and resource: 'Return a raw Hermes CPU flamegraph summary (top hotspot functions by self-time).' It explicitly contrasts itself with react-profiler-analyze and specifies its exact scope (JS CPU hotspots not tied to React rendering), so an agent can distinguish it from sibling profiler tools.

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?

It gives an explicit 'do NOT call' rule, names the sibling tool to use instead (react-profiler-analyze), and states the precise triggering condition ('JS CPU hotspots that are NOT tied to React rendering'). It also mandates the prerequisite call to react-profiler-stop, leaving no ambiguity about sequencing.

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