Skip to main content
Glama

get_thread_stacks

Read-onlyIdempotent

Retrieves call stacks for a process's busiest or specified threads, showing module!function names to reveal where it spends time or is stuck. Briefly suspends threads after a risk confirmation.

Instructions

Call stacks of a process' threads (one thread, or its busiest ones), with module!function names where they can be read: where it spends its time or is stuck. OPENS THE PROCESS and SUSPENDS each thread for a few milliseconds: the first call is refused with the risks; call again with force=true only if the user agreed.

Input Schema

NameRequiredDescriptionDefault
pidYesThe process ID.
tidNoOne thread; left out, its busiest threads.
forceNoTrue only after the user agreed to the risk this tool described.
threadsNoHow many of the busiest threads (default 5, at most 20).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Discloses behavior the annotations cannot convey: the tool OPENS the process and SUSPENDS every thread for a few milliseconds, and the first call is refused with a risk explanation requiring force=true after user consent. This side-effect-and-consent protocol is exactly the kind of context the readOnly/destructive hints do not capture.

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?

Two sentences, both front-loaded with the highest-value information: what you get first, the side effect and consent gate second. Every clause carries weight and nothing is repeated from the schema.

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?

Covers the essentials for a 4-parameter diagnostic tool with no output schema: what is returned (module!function frames), what it does to the target process, and the consent gate. It leaves the exact return shape (number of frames, depth, multi-thread layout) unstated, which an agent must discover at call time.

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 the baseline is 3, but the description adds real meaning: tid vs. threads is framed as 'one thread, or its busiest ones,' and force is tied to a concrete sequencing rule ('call again with force=true only if the user agreed'). It stops short of explaining what counts as 'busiest' or the sampling depth.

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?

States a specific verb and resource ('call stacks of a process' threads') plus the payload shape ('module!function names where they can be read') and the diagnostic intent ('where it spends its time or is stuck'). This clearly separates it from siblings such as get_process, get_wait_chain, or list_modules.

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 gives a clear diagnostic context (finding where a process spends time or is stuck) and an explicit two-step protocol for the risky first call. It does not, however, name alternatives — e.g., when to prefer get_wait_chain for blocking analysis or get_process for basic inspection — so the agent must infer the routing.

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