Skip to main content
Glama
pg-migration-verify
by ColeUD

Verify all migrations

verify_all
Read-onlyIdempotent

Checks every repository migration against the live Postgres catalog, summarizing per-migration status and reporting mismatches, unverifiable statements, and history gaps before deploys.

Instructions

Check every repository migration against the live Postgres catalog. Returns a summary table (per migration: verdict, matched/checked, superseded, unverifiable, recorded in history) and the full report of each MISMATCH. The totals call out migrations applied but not recorded in history and migrations recorded but not fully applied. Use it for the whole picture or before a deploy; use verify_migration for one file. Meaning of the output: MATCH = every object the migration should leave behind exists as written. MISMATCH = at least one object is MISSING (not found), DIFFERENT (found with other attributes, e.g. type or nullability) or UNEXPECTED (dropped or renamed by the migration but still there). MATCH* = a MATCH that does not show the file ran (every check would also hold without it), so "NOT recorded" there does not mean applied by hand. NOTHING TO VERIFY = no statement yields a catalog check. SUPERSEDED = a later migration drops or rebuilds the object or what it depends on (or IF NOT EXISTS skipped the statement), so it cannot be checked against this file; objects renamed later are checked under their new name. UNVERIFIABLE = a statement that cannot be checked against the catalog (DO blocks, GRANTs, data changes); review it by hand. Read-only: it reads migration files and pg_catalog inside a READ ONLY transaction, and never runs migration SQL or writes anything. Needs a database URL (PGMV_DATABASE_URL or DATABASE_URL); without one it returns an error saying how to configure it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "verify_all"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirNoMigrations directory. Relative paths are resolved against the project directory. It must be inside the project directory or the configured migrations directory. Omit to use the configured directory (PGMV_MIGRATIONS_DIR, default supabase/migrations).
verboseNoAlso list objects that match and statements that were ignored. Default false: only problems, superseded objects and unverifiable statements are listed.

Output Schema

NameRequiredDescriptionDefault
totalsYes
historyYesWhether the recorded migration history could be read
directoryYesMigrations directory, relative to the project directory when it is inside it
migrationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, but the description goes further: it reads pg_catalog inside a READ ONLY transaction, never executes migration SQL, and errors out without a configured database URL. It also defines the verdict vocabulary (MATCH, MATCH*, MISMATCH, SUPERSEDED, UNVERIFIABLE, NOTHING TO VERIFY), which is behavior no structured field conveys.

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?

Front-loaded with purpose, scope, and the sibling alternative before the long verdict glossary, so an agent can stop reading early. The glossary is dense but each entry carries real meaning; the length is justified though it borders on encyclopedic for a two-parameter tool.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a verification tool whose value hinges on interpreting verdicts, the description supplies exactly the semantics an agent needs and the auth/config requirement. An output schema exists, so the summary-table/report explanation is partly redundant, but the per-verdict meanings are not recoverable from the schema and are essential.

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 coverage is 100%, so `dir` and `verbose` are fully documented in the schema itself, and the description adds nothing about either (notably silent on `verbose`). Baseline 3 is correct when the schema does all the parameter work.

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?

States a specific verb and resource ("Check every repository migration against the live Postgres catalog") and immediately scopes it against the sibling ("use verify_migration for one file"). An agent can distinguish verify_all from verify_migration without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit selection rule: this tool for "the whole picture or before a deploy," verify_migration for a single file. It also states a prerequisite (a database URL via PGMV_DATABASE_URL or DATABASE_URL) and the failure mode without one, so the agent knows when the call will not work.

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