Skip to main content
Glama

profiler-load

Load saved React or native profiling sessions from disk so query and analysis tools can inspect past recordings without capturing new data; use list mode to find available sessions.

Instructions

Fetch and restore a profiling session that react-profiler-stop or native-profiler-stop saved to disk, so the query tools (profiler-cpu-query, profiler-commit-query, profiler-stack-query) can read it. Use when you need to revisit past session data without capturing a new recording. Modes:

  • list: Show all available profiling sessions in the project's debug directory.

  • load_react: Load a React profiler session (CPU profile + commit tree) into memory. Requires session_id.

  • load_native: Restore native trace data (xctrace XML on iOS, .pftrace on Android). Requires session_id. Loading replaces the session in memory for this device_id (and Metro port, for React): the one the query tools and react-profiler-analyze read. The replaced session stays on disk; load it again by its session_id. Returns a summary of the loaded session or a session list for the list mode. Fails if the session_id is not found or the session's trace files are missing from disk.

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

Input Schema

NameRequiredDescriptionDefault
modeYesWhat to do; see Modes in the tool description.
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.
device_idYesTarget device id from `list-devices`. Used to cache the loaded React session under the correct port+device key, and required to resolve the native profiler session for load_native.
session_idNoTimestamp-based session identifier (e.g. '20250313-143022') from the list output.
app_processNoAndroid package name to pass when restoring an older load_native .pftrace session that has no metadata sidecar.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / app_process / description
      Previous value: -"Android package name to use when restoring older load_native .pftrace sessions that do not have a metadata sidecar."New value: +"Android package name to pass when restoring an older load_native .pftrace session that has no metadata sidecar."
    • changedInput schema / properties / mode / description
      Previous value: -"list: show available sessions on disk. load_react: load a React profiler session into memory for query tools. load_native: re-parse native profiler XML files (xctrace on iOS) into memory for query tools."New value: +"What to do; see Modes in the tool description."
    • 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 / session_id / description
      Previous value: -"Timestamp-based session identifier (e.g. '20250313-143022') from the list output. Required for load_react and load_native modes."New value: +"Timestamp-based session identifier (e.g. '20250313-143022') from the list output."
  2. Changed5 schema fields changedv0.25.0
    • removedInput schema / properties / port / default
      Removed value: -8081
    • changedInput schema / properties / port / description
      Previous value: -"Metro port — the loaded React data is cached under this port for query tools (default 8081)"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.22.0
    • addedInput schema / properties / device_id / minLength
      Added value: +1
  4. First observedv0.15.0

TDQS

A4.6/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 well: it discloses the in-memory replacement side effect scoped to device_id and Metro port, that the replaced session persists on disk and can be reloaded by session_id, what is returned in each mode, and the two failure conditions (unknown session_id, missing trace files). This is exactly the mutation/state context an agent needs.

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 purpose and usage, then a scannable mode list, then side effects and failure modes. Slight redundancy in the repeated "Requires session_id" clauses, but no filler sentences.

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 five parameters, no annotations, and no output schema, the description covers everything an agent needs: per-mode requirements, the state it overwrites, persistence of the replaced session, return shape, and error conditions. Nothing material is left for the agent to guess.

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 meaning on top by tying mode values to requirements (session_id is needed for load_react and load_native) and by clarifying that device_id and the Metro port form the cache key for the loaded session. Only app_process is 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?

Opens with a specific verb and resource ("Fetch and restore a profiling session") and immediately identifies the sibling tools that produce the data (react-profiler-stop, native-profiler-stop) and those that consume it. The three modes (list, load_react, load_native) are enumerated, so an agent can distinguish this from the query/analyze tools without opening a schema.

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?

"Use when you need to revisit past session data without capturing a new recording" gives a clear positive trigger, and the description explains the relationship to the query tools that read the loaded session. It does not state when not to use it (e.g., use the query/analyze tools directly once loaded), so it stops short of full alternatives/exclusions guidance.

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