Skip to main content
Glama

sharphy_deadlock_detector

Detect thread deadlocks and lock contention in .NET memory dumps by building a Wait-For Graph, helping diagnose frozen or unresponsive applications.

Instructions

Detects thread synchronization deadlocks and lock contention by traversing CLR SyncBlocks and building a Wait-For Graph (WFG). Use this tool when diagnosing unresponsive or frozen .NET applications suspected of thread lock cycles. Do NOT use for unhandled exception crashes (use 'sharphy_analyze_dump') or heap analysis (use 'sharphy_inspect_heap'). Non-destructive, read-only inspection.

Input Schema

NameRequiredDescriptionDefault
dumpPathYesAbsolute path to the target memory dump file (.dmp)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the safety burden itself by declaring 'Non-destructive, read-only inspection,' which resolves the mutation question outright. It also describes the analysis approach (SyncBlock traversal, WFG construction), though it says nothing about expected runtime, dump-size limits, or the shape of the results an agent should expect.

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?

Three sentences, each doing distinct work: what it does, when to use it, when not to and what to use instead, plus the safety note last. Front-loaded with the core capability and free of 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 single-parameter, read-only tool with no output schema and no annotations, the description covers purpose, usage routing, and safety adequately. The remaining gap is that it never hints at what the Wait-For Graph analysis returns (cycle participants, contention rankings), which would help an agent interpret results.

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?

There is a single required parameter with 100% schema description coverage ('Absolute path to the target memory dump file (.dmp)'), so the schema already fully documents it. The description adds no further detail such as path constraints, supported dump formats, or whether the file must match the running analysis version, so baseline 3 applies.

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 names a specific verb and resource ('Detects thread synchronization deadlocks and lock contention') and discloses the mechanism (traversing CLR SyncBlocks, building a Wait-For Graph). It is clearly distinguishable from siblings like sharphy_inspect_heap and sharphy_analyze_dump, which are explicitly named as the wrong tools for adjacent jobs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the exact triggering condition ('diagnosing unresponsive or frozen .NET applications suspected of thread lock cycles') and gives explicit exclusions with named alternatives for exception crashes and heap analysis. Nothing is left to inference about when to pick this tool.

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