Skip to main content
Glama

check_migration_safety

Audit PostgreSQL, MySQL, or SQLite migrations for production locks and rolling-deployment breaking changes, then generate a safe three-phase Expand-Contract plan.

Instructions

Audit a SQL migration (PostgreSQL, MySQL, or SQLite) for production table locks, rolling-deployment breaking changes (DROP/RENAME COLUMN, blocking CREATE INDEX, ADD COLUMN NOT NULL without DEFAULT, ALTER COLUMN TYPE rewrite, unvalidated constraints, missing lock_timeout), and auto-generate a safe 3-phase Expand-Contract deployment plan.

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": {
      "sql": "<sql>"
    },
    "name": "check_migration_safety"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne or more SQL DDL/DML migration statements to analyze.
dialectNoSQL dialect (default: postgres).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does good work describing the analytical coverage and that a remediated plan is produced, but it never resolves whether the tool merely reads the SQL or actually applies anything, and it says nothing about size limits, permissions, or how findings are reported. For an audit tool that a cautious agent might otherwise fear mutates a database, leaving the read-only nature implicit is a real gap.

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?

A single sentence, but front-loaded with the verb and resource before the long parenthetical checklist, so an agent gets the gist immediately. The enumerated hazards are dense yet each one is informative rather than filler; splitting the audit and plan-generation halves would improve scannability slightly.

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

Completeness3/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 must convey the return shape, and it only says a 'safe 3-phase Expand-Contract deployment plan' is generated — it never describes the audit findings structure, severity levels, or whether the plan is returned as SQL, prose, or steps. Enough is present to call the tool correctly, but not enough to know what comes back.

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 only two parameters, so the schema already documents `sql` and the `dialect` enum. The description's mention of PostgreSQL/MySQL/SQLite mirrors the enum rather than adding new meaning, and it adds no guidance on multi-statement input, dialect-specific defaults, or size constraints beyond 'one or more SQL DDL/DML statements'.

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 a specific resource ('a SQL migration'), then enumerates the exact hazards checked (table locks, DROP/RENAME COLUMN, blocking CREATE INDEX, ADD COLUMN NOT NULL without DEFAULT, unvalidated constraints, missing lock_timeout) plus the second capability of generating a 3-phase Expand-Contract plan. The scope is narrow enough (migration DDL only) to be implicitly distinct from audit_code_snippet and audit_codebase_architecture, but no sibling is named or contrasted.

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?

Usage is only implied: an agent can infer this is for pre-deployment review of migration SQL, and the parenthetical dialect list hints that non-migration code or other languages are out of scope. There is no explicit statement of when to prefer this over the other audit tools, no prerequisites, and no guidance on what input is unacceptable (e.g. non-DDL statements).

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