Skip to main content
Glama

review_migration

Checks MySQL DDL and migration scripts for locking, data-loss, and replication risks, then returns a safe/review/block verdict with line-specific fixes.

Instructions

Review MySQL DDL or a migration script for locking, data-loss and replication risks.

Args: sql: The SQL to run, one or more statements separated by semicolons. schema: Optional CREATE TABLE statements for the tables involved (e.g. from SHOW CREATE TABLE). Makes column-type and index checks exact. stats: Optional size per table from information_schema.tables: a row count ({"orders": 25000000}) or {"orders": {"rows": 25000000, "data_bytes": <data_length>, "index_bytes": <index_length>}}. Large = 1M rows or 5 GB. mysql_version: Optional target server version, e.g. "8.0.28", "8.4.3" or "aurora-3.04" (SELECT VERSION()). Older servers copy the table for more column changes. Without it, 8.0.29 or later is assumed. free_disk_gb: Optional free space on the server's data volume, in GB. With byte sizes in stats, a table rebuild that does not fit is blocked. rollback_sql: Optional down migration kept in a separate file (e.g. a golang-migrate .down.sql or Flyway U__ file). Down sections and --rollback lines inside sql are found without it.

Returns a verdict (safe / review / block) and findings with line, impact and fix.

Input Schema

NameRequiredDescriptionDefault
sqlYes
statsNo
schemaNo
free_disk_gbNo
rollback_sqlNo
mysql_versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.3

TDQS

A4.5/5.0
Behavior4/5

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

No annotations exist, so the description carries the burden and does substantial work: it discloses the return shape (verdict of safe/review/block with findings containing line, impact, fix) and a key hidden assumption ('Without it, 8.0.29 or later is assumed'), which materially affects verdicts. It does not explicitly state that nothing is executed against the server or what access/permissions it needs, leaving one notable gap for a no-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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and return contract are front-loaded in a single sentence, followed by a dense per-argument block where every line adds information an agent would otherwise have to guess. No filler or restatement of the tool name.

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?

For a six-parameter analysis tool with no annotations and no output schema, the description covers inputs thoroughly, states the verdict vocabulary, and documents a default assumption. Only the execution/safety model (does it touch the target server, what connection or credentials it uses) is left implicit.

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

Parameters5/5

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

Schema description coverage is 0% and all six parameters carry only bare titles, so the description must compensate — and it does. It gives the exact JSON shape for stats with a concrete example, version string examples including a vendor variant, the 1M rows / 5 GB threshold definition, the cross-parameter interaction between stats bytes and free_disk_gb, and where rollback comes from.

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 opening sentence names a specific verb (review), a specific resource (MySQL DDL or migration script), and the exact risk classes examined (locking, data-loss, replication). The resource scope is distinct from siblings like review_query and review_code, so an agent can route correctly without opening the schema.

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?

Usage context is clear from the risk framing — analyze a migration before running it — and each optional input is justified by what it enables ('Makes column-type and index checks exact', 'a table rebuild that does not fit is blocked'). There is no explicit exclusion or named alternative (e.g. when to prefer preflight_checks), which keeps it below a 5.

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