Skip to main content
Glama

lock_wait_rca

Read-only

Build InnoDB wait-for trees, identify the root blocker, and parse the latest deadlock. Analyze supplied lock-wait pairs offline or omit them to pull the live lock graph.

Instructions

[READ] Build the InnoDB wait-for tree, name the root blocker, and parse the last deadlock out of SHOW ENGINE INNODB STATUS.

Pass 'pairs' (as from lock_waits) for pure/offline analysis, or omit to pull the current lock-wait graph live.

Args: pairs: Injected lock-wait pairs {blockedId, blockingId, ...}; if omitted, pulled live (flavor-branched). include_deadlock: Also parse the LATEST DETECTED DEADLOCK section from SHOW ENGINE INNODB STATUS (default True). target: Target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
pairsNo
targetNo
include_deadlockNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.3/5.0
Behavior4/5

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

The readOnlyHint annotation already establishes a safe read-only profile, so the description adds useful context on top: it discloses that the live pull is 'flavor-branched', that it parses the LATEST DETECTED DEADLOCK section, and that include_deadlock defaults to True. It does not discuss permissions or output shape, but those are largely covered.

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?

Front-loads the core action in the first sentence, then the mode selection, then an Args block. Efficient and well organized, with only minor redundancy between the prose and the Args listing.

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?

With no output schema, the description correctly explains what is produced (wait-for tree, root blocker, deadlock section) and how each input mode behaves. Given the read-only annotation and three optional params, this is essentially complete for correct invocation.

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 description coverage is 0%, so the description carries the full parameter burden. It documents all three: 'pairs' with its {blockedId, blockingId, ...} shape and the live-pull fallback, 'include_deadlock' with its default, and 'target' as a config name. This fully compensates for the empty schema.

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 specific verbs and resources: builds the InnoDB wait-for tree, names the root blocker, and parses the last deadlock from SHOW ENGINE INNODB STATUS. This clearly distinguishes it from the sibling lock_waits, which surfaces the raw pairs, and the [READ] tag signals the operation class.

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 routes the caller: pass 'pairs' (from lock_waits) for offline analysis, or omit to pull the live graph. It names the sibling that produces the input and gives the condition for each mode, though it stops short of stating when NOT to use this tool versus lock_waits.

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