Skip to main content
Glama

analyze_transaction_and_locking

Audit SQL or application transaction blocks to detect lost-update race conditions from missing FOR UPDATE, external network calls inside open transactions, and deadlock risks.

Instructions

Audit SQL or application transaction blocks to detect Lost Update race conditions (missing FOR UPDATE), external HTTP/network calls inside open transactions, and deadlock risks.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "dialect": "<dialect>",
      "source": "<source>"
    },
    "name": "analyze_transaction_and_locking"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYes
dialectYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the audit's detection scope, which is real behavioral information, but never states that this is a static read-only analysis, whether it executes code, or how results are surfaced. Useful but incomplete for a zero-annotation tool.

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?

One dense sentence with zero filler, front-loading the verb and the three detection targets. Sized appropriately for a two-parameter tool, though it could have traded a clause of detection detail for practical usage guidance.

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

Completeness2/5

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

No annotations, no output schema, a nested oneOf input, and 0% schema coverage mean the description must explain the source modes and dialect behavior — it explains neither. An agent knows what the tool checks but not how to shape input or what it gets back.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the source parameter is a oneOf requiring either code_or_sql_snippet or file_paths — a non-obvious union the description never mentions. The dialect enum (postgresql/mysql) is also undocumented, so the description adds nothing beyond raw schema structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Audit') and resource ('SQL or application transaction blocks') plus the exact defect classes it hunts: Lost Update, network calls inside transactions, deadlock risks. No sibling tool overlaps this concern, so the purpose is distinguishable, though the description never explicitly differentiates itself from the sibling analyzers.

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

Usage Guidelines3/5

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

The three named defect classes imply when the tool is relevant, but there is no explicit when-to-use statement, no prerequisites, and no routing to alternatives such as analyze_explain_plan or scan_project_queries. The agent must infer the selection criteria from the detection list.

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