Skip to main content
Glama

react-profiler-analyze

Analyze stored React Native profiling data and generate a markdown performance report highlighting hot commits and root causes, enabling targeted fixes or re-profiling.

Instructions

Analyze stored profiling data and return a markdown performance report. Returns { report, reportFile, hotCommitsTotal, hotCommitsShown, sessionFiles }. The report is structured around hot React commits (≥16ms absolute floor) with per-commit render cascades, root cause identification, and a top components table. Raw profiling data is saved to disk with a unique session timestamp for later reload via profiler-load. After presenting the report, ask the user whether to investigate further (drill-down with profiler-cpu-query / profiler-commit-query) or implement fixes and re-profile for comparison. Requires react-profiler-stop to have been called first. Optional annotations param: provide Array<{offsetMs, label}> to annotate commits with the user action that preceded them. Compute offsetMs = tapTimestampMs - startedAtEpochMs where tapTimestampMs is the timestampMs returned by the tap/swipe tool and startedAtEpochMs is returned by react-profiler-start. Use when the profiling session is complete and you need to interpret the collected data. Fails if react-profiler-stop has not been called or no profiling data 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.
platformNoTarget platformios
device_idYesDevice logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId).
rn_versionNoReact Native version (e.g. "0.73.4")unknown
annotationsNoOptional list of user actions with their time offset from profiling start. Compute offsetMs = tapTimestampMs - startedAtEpochMs, where tapTimestampMs comes from the tap/swipe tool return value and startedAtEpochMs comes from react-profiler-start return value.
project_rootYesAbsolute path to the RN project root for session context detection

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.8/5.0
Behavior5/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 thoroughly discloses the return shape, the report's focus (hot commits ≥16ms with render cascades and root-cause identification), the side effect of saving raw data to disk for later profiler-load, the necessary preceding call, failure conditions, and the required post-report interaction (ask the user whether to drill down or fix and re-profile). The agent is fully informed of side effects and workflow constraints.

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 longer than minimal but well-structured, progressing from purpose to return values, report structure, side effect, follow-up workflow, prerequisite, annotation guidance, usage condition, and failure mode. It is front-loaded with the core purpose. The slight redundancy is the annotation formula being repeated from the schema, but the additional sentences all carry meaningful context.

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?

With 6 parameters, no output schema, and no annotations, this description is remarkably complete. It covers the returned object, the report's content, the disk persistence side effect, the mandatory prerequisite, failure scenarios, and even the recommended next action after presentation. There is no critical gap that would prevent an agent from invoking the tool 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 description coverage is 100%, so the baseline is 3. The description adds value beyond the schema by explicitly restating the annotations parameter's computation formula (offsetMs = tapTimestampMs - startedAtEpochMs) and its intent (annotating commits with the user action that preceded them). This reinforcement helps the agent construct that parameter correctly, even though the schema already contains similar detail.

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 specific verb+resource statement: 'Analyze stored profiling data and return a markdown performance report.' It clearly identifies the tool's role as the analysis step for profile data, and it distinguishes itself from siblings by referencing profiler-load for later reload and profiler-cpu-query / profiler-commit-query for drill-down. An agent can unambiguously determine this tool produces the main report.

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 makes the usage condition explicit: 'Use when the profiling session is complete and you need to interpret the collected data.' It adds a hard prerequisite ('Requires react-profiler-stop to have been called first'), describes the failure mode ('Fails if react-profiler-stop has not been called or no profiling data is stored'), and points to alternatives for follow-up actions (drill-down queries or re-profiling). This is a model of usage guidance.

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