Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

schema_diff

Compare two PostgreSQL schema endpoints and generate the DDL differences. Produces a migration script to make the target schema match the source.

Instructions

Compute the DDL delta between two { server, database, schema } endpoints. Returns objects to CREATE (in source but not target), DROP (in target but not source), and MODIFY (in both, but DDL differs), plus a single migrationSql script that, when applied to the TARGET, converges its schema with the SOURCE. CREATE OR REPLACE is used for views/functions/procedures; DROP+CREATE for everything else. Source is the source of truth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
targetYes
Behavior4/5

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

The description discloses behavioral traits: it uses CREATE OR REPLACE for views/functions/procedures and DROP+CREATE for others. It also specifies the migration script direction (apply to target to converge with source). However, it lacks information on performance constraints or large schema handling.

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 description is concise (under 80 words), front-loads the main action, and efficiently conveys key details about output and behavioral rules without redundancy.

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?

The description explains the output types (CREATE, DROP, MODIFY, migrationSql) and the migration strategy. However, it does not provide details on the exact output structure (e.g., whether migrationSql is a string or array) or pagination. Given the complexity and lack of output schema, it is fairly complete but has minor gaps.

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?

The input schema parameters are self-explanatory (source and target objects with server, database, schema). The description adds no further detail about each parameter, and schema coverage is 0%. It merely references the endpoints without elaborating on required fields or defaults.

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 clearly states the tool computes the DDL delta between two endpoints, specifying the output (CREATE, DROP, MODIFY, migrationSql). It distinguishes from siblings like detect_migration_state by focusing on delta generation.

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?

The description implies usage for schema migration planning but does not explicitly state when to use it over alternatives such as detect_migration_state or dry_run_sql_file. The phrase 'Source is the source of truth' provides some context but no exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Teja-sudo/postgres-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server