Skip to main content
Glama

generate_zero_downtime_ddl

Read-onlyIdempotent

Rewrites hazardous PostgreSQL/MySQL DDL migrations into safe multi-phase Expand/Contract runbooks to avoid lock queues and table rewrites, including rollback scripts.

Instructions

Rewrites hazardous SQL migrations into multi-phase Expand/Contract runbooks using CREATE INDEX CONCURRENTLY, NOT VALID + VALIDATE CONSTRAINT, lock_timeout, ALGORITHM=INSTANT, and emergency Rollback scripts.

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": "generate_zero_downtime_ddl"
  }
}

Input Schema

NameRequiredDescriptionDefault
qpsNoEstimated peak production queries per second (defaults to 800).
sqlYesHazardous or unguarded PostgreSQL/MySQL DDL migration script to rewrite into safe phases.
dialectNoSQL dialect override (defaults to auto).
tableRowsNoEstimated row count on the target table (defaults to 10000000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish the safe read-only, idempotent, closed-world profile, so the description is not required to restate safety. It adds real value by disclosing the shape of the output — phased Expand/Contract steps plus emergency Rollback scripts — which is not in any structured field since there is no output schema. It stops short of saying whether the result is executable SQL versus prose guidance or how large outputs are handled.

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?

A single sentence with the action, the target, and the distinguishing techniques front-loaded. Every clause contributes specific technical content; there is no filler or boilerplate.

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 tool with no output schema, the description adequately characterizes what comes back (phased runbook plus rollback scripts) and how to phrase the input. The only remaining gaps — whether input is executed and how sizing parameters affect the plan — are modest given full parameter documentation and complete annotations.

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%, so the definitions for sql, dialect, tableRows, and qps already carry their own meaning and defaults. The description mentions no parameter behavior, such as how tableRows/qps influence the generated plan, so it adds no meaning beyond the schema and the baseline of 3 applies.

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 uses a concrete verb ('Rewrites') with a clearly bounded input ('hazardous SQL migrations') and a named output ('multi-phase Expand/Contract runbooks'). The specific techniques listed (CREATE INDEX CONCURRENTLY, NOT VALID + VALIDATE CONSTRAINT, lock_timeout, ALGORITHM=INSTANT) make the produced artifact unambiguous and clearly distinct from the estimate/audit siblings.

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 qualifier 'hazardous SQL migrations' and the schema's 'Hazardous or unguarded ... migration script', so an agent can infer this is the remediation tool. However, there is no explicit when-to-use, no precondition (e.g. run estimate_ddl_blast_radius first), and no reference to the audit or estimate siblings, leaving the ordering of the workflow to inference.

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