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

Show what a migration should create

expected_objects
Read-onlyIdempotent

Parses one migration with the real Postgres parser to list the database objects it should create, helping review changes before applying without connecting to a database.

Instructions

Parse one migration with the real Postgres parser and list what it should leave in the database: schemas, tables, columns (type, nullability), indexes, constraints, functions, triggers, row level security, policies, types and enum values, each with its line, plus statements that cannot be checked (UNVERIFIABLE) or have no lasting effect (ignored, e.g. BEGIN or SET). Never connects to a database. Use it to review a migration before applying it, or to understand a verify_migration result. Read-only: it reads migration files and pg_catalog inside a READ ONLY transaction, and never runs migration SQL or writes anything.

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": {
      "file": "<file>"
    },
    "name": "expected_objects"
  }
}

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).
fileYesThe migration: its file name (20240101120000_create_profiles.sql), a path ending in it, its version (20240101120000) or its name (create_profiles). Only exact matches count.

Output Schema

NameRequiredDescriptionDefault
fileYes
notesYesStatements that are not turned into catalog checks
objectsYes
statementCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real substance beyond them: it never connects to a database, reads pg_catalog inside a READ ONLY transaction, never executes migration SQL, and classifies statements as UNVERIFIABLE or ignored (e.g. BEGIN, SET). Those are behavioral facts an agent cannot get from the schema or hints.

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 the core action and the return inventory, with no filler sentences. The final 'Read-only:' clause partly restates 'Never connects to a database' and the readOnly annotations, which is mild redundancy, but the paragraph stays information-dense.

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 two-parameter read-only inspection tool with a full output schema and complete annotation coverage, the description supplies everything needed: scope, output categories, failure classifications, safety model, and the sibling relationship. Nothing required to invoke it correctly is missing.

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 both `file` (name/path/version/name matching) and `dir` (resolution rules, default PGMV_MIGRATIONS_DIR) are already fully documented in the schema. The description adds nothing parameter-specific, so the baseline 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?

Specific verb+resource: 'Parse one migration with the real Postgres parser and list what it should leave in the database', followed by an explicit inventory of what is reported (schemas, tables, columns, indexes, constraints, functions, triggers, RLS, policies, types, enums). This clearly separates it from verify_migration, which the description positions as the comparison step whose result this tool helps explain.

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?

Gives two concrete usage contexts: 'review a migration before applying it' and 'understand a verify_migration result', which routes the agent relative to a named sibling. It lacks an explicit exclusion (e.g. 'use verify_migration/list_recorded_migrations instead when you want X'), so it is strong but not fully symmetric guidance.

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