Skip to main content
Glama

Analyze a SQL migration for locking hazards

analyze_migration

Lint PostgreSQL migrations for dangerous locking operations and receive PASS/REVIEW/BLOCK verdicts with safe rewrites before applying.

Instructions

Lint a PostgreSQL migration for operations that take dangerous locks (table rewrites, blocking index builds, validating constraints, destructive/breaking changes) and return a PASS/REVIEW/BLOCK verdict with per-statement findings and safe rewrites. Call this before applying or approving any migration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe full SQL migration script to analyze.
assumeLargeTablesNoAssume target tables are large/hot, so scans and rewrites are flagged. Default true (fail safe).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statsYes
summaryYes
verdictYes
findingsYes
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description provides substantial behavioral detail: it lists specific hazard types (table rewrites, blocking index builds, validating constraints, destructive changes) and the return format (verdict with findings and safe rewrites). It does not explicitly state whether it performs static analysis or side effects, but the linting framing implies a read-only operation.

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 two sentences long, with the first sentence packed with specific technical detail and the second giving direct usage guidance. Every word earns its place, with no redundancy or 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?

Given the description, input schema with parameter semantics, and the presence of an output schema, the tool is well specified for an agent to select and invoke it. The only gap is not explicitly stating whether it performs static analysis or requires a database connection, but the linting context and output schema make this adequate.

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?

The input schema already provides full descriptions for both parameters (sql and assumeLargeTables) with 100% coverage. The tool description adds no additional parameter semantics beyond what the schema offers, so the baseline score of 3 is appropriate.

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 clearly states the tool's function: 'Lint a PostgreSQL migration for operations that take dangerous locks' and the output verdict (PASS/REVIEW/BLOCK). It distinguishes from the sibling tool 'explain_lock' by focusing on migration linting and returning safe rewrites, not just explaining locks.

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 explicitly says 'Call this before applying or approving any migration,' which gives clear usage context. It does not mention when not to use it or name alternative tools, but the timing guidance is direct and actionable.

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

Other Tools

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/cxk280/locksmith'

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