Skip to main content
Glama

analyze_migration

Audit PostgreSQL and MySQL SQL DDL or migration paths against DBA standards before deployment, flagging risky data types, unindexed foreign keys, locking DDL hazards, and normalization issues.

Instructions

Audit SQL DDL statements, migration files, or migration directory against DBA best-practice rules (data types, unindexed FKs, locking DDL hazards, 1NF, alignment padding) for PostgreSQL or MySQL.

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>",
      "migration_source": "<migration_source>"
    },
    "name": "analyze_migration"
  }
}

Input Schema

NameRequiredDescriptionDefault
dialectYesTarget database engine dialect.
strictnessNostandard
engine_versionNoDatabase version (e.g., 16 for PG, 8.0 for MySQL).latest
migration_sourceYesProvide raw_sql, file_paths array, or migration_dir path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It mentions what rules are checked, but does not explicitly state that the tool is read-only/non-destructive, whether it executes or modifies migrations, how findings are reported, or what happens with invalid SQL.

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?

The description is a single front-loaded sentence with no filler. It is dense but appropriate for the tool's scope, though it could be split for easier scanning of rule categories and dialect support.

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?

There is no output schema and no annotations, so the description should do more to explain the audit result shape, severity reporting, and non-destructive behavior. It adequately names inputs and rule categories but leaves important behavioral and result-context gaps for a nested, multi-source audit tool.

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 75%, so the schema already documents most parameters, including dialect, engine_version, and migration_source alternatives. The description reinforces the supported dialects and migration-source forms, but adds no meaning for strictness or how engine_version affects rule evaluation.

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?

The description gives a specific verb ('Audit') and concrete resources ('SQL DDL statements, migration files, or migration directory'), and names the rule categories and supported dialects. It is clear what the tool does, though it does not explicitly distinguish itself from sibling tools such as plan_zero_downtime_migration or analyze_transaction_and_locking.

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 implied by the audit framing and the accepted migration inputs, but the description does not state when to use this tool versus alternatives like plan_zero_downtime_migration or analyze_transaction_and_locking. No exclusions, prerequisites, or workflow positioning are provided.

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