Skip to main content
Glama

profiler-cpu-query

Query Hermes CPU profile data to find hotspots, analyze time ranges, view call trees, or aggregate per component. Correlate CPU cost with specific components.

Instructions

Query Hermes CPU profile data with targeted modes for iterative investigation. Requires react-profiler-stop (and ideally react-profiler-analyze) to have been called first. Modes:

  • top_functions: Global CPU hotspots ranked by self-time. Optional time_window_ms to filter.

  • time_window: CPU breakdown for a specific time range (e.g. during a slow commit or hang).

  • call_tree: For a given function_name, show its callees and optionally callers.

  • component_cpu: For a given component_name, aggregate CPU activity across all its commits. Use when investigating JS CPU hotspots or correlating CPU cost with specific components. Returns a markdown table of CPU hotspots, call tree, or per-component CPU breakdown. Fails if no CPU profile is stored — run react-profiler-stop first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesQuery mode: top_functions (global hotspots), time_window (CPU in a time range), call_tree (callers/callees of a function), component_cpu (CPU during a component's commits)
portNoMetro server port
top_nNoNumber of results to return (default 15)
device_idYesDevice logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId).
function_nameNoFunction name for call_tree mode
component_nameNoComponent name for component_cpu mode
time_window_msNoTime window filter for time_window mode (ms, performance.now clock)
include_callersNoFor call_tree mode: also show callers of the function
Behavior4/5

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

Since no annotations are provided, the description carries full burden. It discloses that the tool returns a markdown table, fails if no profile is stored, and describes each mode's behavior. It implies read-only access by being a query tool. However, it does not mention potential side effects, rate limits, or auth requirements, but these are not critical for a CPU query tool.

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 appropriately sized and front-loaded with the purpose. It has a clear structure: introduction, prerequisites, mode list with explanations, usage guidance, and failure condition. Every sentence adds value, though it could be slightly more concise without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description mentions returns a markdown table but does not detail the format for each mode. It does not clarify how top_n applies to non-top_functions modes. The time_window_ms object is described in schema but not elaborated in description. For 8 parameters and multiple modes, the description is adequate but leaves some behavioral details implicit.

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. The description adds value by grouping parameters with modes (e.g., function_name for call_tree, component_name for component_cpu) and explaining the time_window_ms nested object context. It provides usage context that the schema alone does not, such as the effect of include_callers in call_tree mode.

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 it queries Hermes CPU profile data with targeted modes for iterative investigation. It lists four specific modes (top_functions, time_window, call_tree, component_cpu) with their purposes, making the tool's function and scope immediately clear. It distinguishes itself from sibling tools like profiler-commit-query and profiler-stack-query by focusing on CPU profiling.

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?

The description explicitly states prerequisites: 'Requires react-profiler-stop (and ideally react-profiler-analyze) to have been called first' and 'Fails if no CPU profile is stored — run react-profiler-stop first'. It also indicates when to use the tool: 'Use when investigating JS CPU hotspots or correlating CPU cost with specific components.' While it does not explicitly list when not to use it versus alternatives, the mode descriptions provide sufficient context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/software-mansion/argent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server