Skip to main content
Glama

Debug This Hang

debug_this_hang
Destructive

Diagnose stuck, deadlocked, or spinning processes by pausing the target, collecting bounded stacks from every thread, and applying wait-state and cross-thread pointer-provenance analysis.

Instructions

High-level native hang workflow for all-thread triage. Use it when a live process appears stuck, deadlocked, waiting forever, or spinning and you need bounded stacks from every thread, wait-state/deadlock heuristics, and cross-thread Pointer-Provenance v2. In current mode it inspects an existing configured session and pauses a running live target when necessary; codelldb, lldb-dap, gdb, and live modes can launch or attach to an authorized local target, observe it for a bounded interval, then pause it for evidence. Do not use executable/attach modes when target execution or debugger control is not authorized, and do not treat a deadlock-candidate as a proven lock cycle because generic DAP does not expose portable lock ownership.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for adapter-owned launches and a project-root hint for hang triage.
envNoEnvironment variables supplied to adapter-owned launched programs.
pidNoRequired for codelldb/lldb-dap/gdb attach modes; ignored for launch and generic live configuration.
argsNoCommand-line arguments for codelldb/lldb-dap/gdb launch modes.
modeNocurrent triages the configured session; live uses an already initialized generic DAP adapter; codelldb/lldb-dap/gdb discover and start that adapter before launch/attach.current
programNoRequired for codelldb/lldb-dap/gdb launch; optional executable image hint for adapter-specific attach.
requestNoFor live or adapter-owned modes, launch starts a program and attach connects to an existing authorized process.launch
analysisNoOptional project roots/modules used to recognize project-controlled frames across all threads.
observeMsNoBounded interval after launch/attach during which a normal stop or process exit prevents automatic hang-timeout classification.
sessionIdNoOptional DAP session ID. Omit to use the backward-compatible default session.
maxThreadsNoMaximum threads to collect for bounded all-thread triage.
adapterPathNoOptional explicit CodeLLDB, lldb-dap, or GDB executable path; omit to use adapter discovery.
stackLevelsNoMaximum stack frames collected per thread.
configurationNoRequired only for mode=live: adapter-specific DAP launch/attach configuration.
pauseBudgetMsNoAggregate wall-clock budget across thread enumeration and all pause requests. This prevents per-thread pause timeouts from multiplying across large thread sets.
pauseTimeoutMsNoMaximum time to wait for any single pause request used to freeze a suspected live hang.
captureTimeoutMsNoGlobal deadline for all-thread stack/scope/variable evidence collection after the pause phase. When it expires, remaining threads are retained as partial/unclassified evidence instead of extending the workflow per thread.
requestTimeoutMsNoPer-request timeout for starting and configuring an adapter-owned DAP session.
framesWithVariablesNoMaximum frames per thread whose locals/arguments are collected, prioritizing the top frame and first project-controlled frame.
maxVariablesPerFrameNoMaximum local/argument variables collected per selected frame scope for Pointer-Provenance v2.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
statusYes
evidenceNo
diagnosisNo
observationYes

Schema Changelog

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

  1. Addedv0.17.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already carry destructiveHint=true, so the destructive nature is known. The description adds meaningful behavioral context beyond that: it can pause a running live target, launches or attaches via several adapters, observes for a bounded interval, and explicitly warns that generic DAP cannot prove lock ownership. This is valuable operational disclosure that annotations do not provide.

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?

The description is dense but every sentence earns its place: the first sentence states purpose and trigger conditions, the second explains mode behavior, the third states a safety exclusion, and the fourth adds an important epistemic caveat about lock-cycle interpretation. Content is front-loaded and there is 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 tool this complex—20 parameters, nested objects, five modes, output schema present, and rich annotations—the description covers the essential workflow, mode distinctions, and safety boundaries. It could be more complete by explicitly contrasting with debug_this_crash, but an agent has enough to call it correctly given the exhaustive input schema and output schema.

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%, with each parameter already documented in detail. The description adds workflow-level context but no per-parameter meaning beyond the schema, so the baseline 3 is appropriate: the structured field descriptions do the heavy lifting.

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 states a specific verb and resource: a 'high-level native hang workflow for all-thread triage.' It immediately names the triggering conditions (stuck, deadlocked, waiting forever, spinning) and the deliverable (bounded stacks from every thread, wait-state/deadlock heuristics, Pointer-Provenance v2), which clearly distinguishes it from the sibling crash-focused tools like debug_this_crash.

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 explicit when-to-use criteria ('Use it when a live process appears stuck...') and a clear exclusion: do not use executable/attach modes when target execution or debugger control is not authorized. It does not explicitly name which sibling to use instead for crash triage, so it falls just short of full alternative routing, but the context is otherwise strong.

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/SLP-DEV1/qwen-dap-mcp'

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