Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Compare schemas

compare_schemas
Read-only

Identify structural differences between two PostgreSQL schemas, covering additions, removals, and changes to tables, columns, indexes, constraints, and foreign keys for base tables only.

Instructions

Return the structural diff between two schemas — tables/columns/indexes/constraints/foreign-keys added, removed, or changed. Base tables only; views and custom types are not compared. Renames surface as a paired add + remove.

Example: compare_schemas(left_schema='public', right_schema='staging')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
left_schemaYes
right_schemaYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
left_schemaYes
right_schemaYes
tables_addedYes
tables_changedYes
tables_removedYes
Behavior5/5

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

The description reveals that renames surface as paired add+remove and lists the exact structural elements compared. This adds value beyond the readOnlyHint annotation by detailing the diff behavior and limitations.

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 three sentences long, front-loaded with the main purpose, and includes a concise example. Every sentence adds necessary information 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 covers what is compared, the exclusion of views and custom types, and how renames appear. With an existing output schema for return format, the description is sufficiently complete for a structural diff tool.

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

Parameters4/5

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

Schema description coverage is 33% (only 'database' described). The description compensates with an example showing left_schema and right_schema as schema names, clarifying their usage. However, it does not elaborate on additional constraints or values.

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 returns a structural diff between two schemas, listing specific elements (tables, columns, indexes, etc.) and explicitly excludes views and custom types. This distinguishes it from any sibling tool, as no other tool performs schema comparison.

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?

The description specifies that only base tables are compared and gives an example call. Although it does not explicitly list alternatives or exclusions, the scope is clear and sufficient for an agent to understand when to use it.

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/devopam/MCPg'

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