Skip to main content
Glama

profiler-stack-query

Diagnose native performance problems by querying parsed profiler data for hang stacks, function callers, thread CPU breakdowns, or leak stacks. Get a markdown report with call stacks and weights.

Instructions

Query native profiler trace data for iterative investigation of native performance. Requires native-profiler-stop → native-profiler-analyze to have been called first. Modes:

  • hang_stacks: Full CPU context during a specific hang (by hang_index).

  • function_callers: Who calls a specific native function and what it calls.

  • thread_breakdown: CPU time split by thread, optionally filtered.

  • leak_stacks: Memory leak details (iOS only), optionally filtered by object_type. Use when drilling into native hang stacks, thread CPU breakdown, or memory leaks after native-profiler-analyze. Returns a markdown report with native call stacks, thread weights, or leak details for the selected mode. Fails if native-profiler-analyze has not been run or no parsed trace data is in memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesQuery mode: hang_stacks (full CPU context during a hang), function_callers (who calls a native function), thread_breakdown (CPU split by thread), leak_stacks (leak details by object type)
top_nNoMax results to return (default 15)
threadNoThread filter. thread_breakdown: case-insensitive substring match. function_callers: exact raw thread name (e.g. ".blueskyweb.app"), or "main" for the UI thread; omit to search ALL threads (each result is tagged with its thread). Run thread_breakdown first to see the exact raw names.
device_idYesiOS Simulator UDID or Android serial.
hang_indexNo0-based index into the hang list for hang_stacks mode
object_typeNoObject type filter for leak_stacks mode
function_nameNoFunction name for function_callers mode

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.22.0
    • addedInput schema / properties / device_id / minLength
      Added value: +1
  2. First observedv0.15.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It discloses the prerequisite, failure condition ('Fails if native-profiler-analyze has not been run'), iOS-only restriction for leak_stacks, and return format (markdown report). It doesn't explicitly state read-only or side effects, but 'Query' and the failure discussion make it clear.

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?

Description is well-structured and front-loaded: prerequisite first, then bulleted modes, usage guidance, return type, and failure condition. Every sentence contributes meaningful information with no filler.

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

Completeness4/5

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

For a 7-parameter tool with no annotations and no output schema, the description covers prerequisites, mode behavior, filters, output type, and error cases. It could be slightly more complete with an example invocation or more detail on the iterative workflow, but it is nearly sufficient for an agent to select and use the tool correctly.

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 baseline is 3. The description reinforces mode semantics and adds small details (e.g., function_callers shows what a function calls, leak_stacks is iOS-only), but it does not significantly expand on the parameter schema, which already documents 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?

Description uses specific verb 'Query' with clear resource 'native profiler trace data' and enumerates four distinct modes with precise behaviors. It clearly distinguishes from sibling profiler tools by specifying that native-profiler-analyze must have been called first.

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?

Explicitly states prerequisite chain ('Requires native-profiler-stop → native-profiler-analyze') and gives a clear use case: 'Use when drilling into native hang stacks, thread CPU breakdown, or memory leaks after native-profiler-analyze.' However, it does not name alternatives or explicitly state when not to use this tool versus other profiler query tools.

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

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