Compare schemas
compare_schemasCompare two PostgreSQL schemas to find added, removed, or changed tables, columns, indexes, constraints, and foreign keys. Review structural differences before migrations or deployments.
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')
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": {
"left_schema": "<left_schema>",
"right_schema": "<right_schema>"
},
"name": "compare_schemas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| left_schema | Yes | ||
| right_schema | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| left_schema | Yes | ||
| right_schema | Yes | ||
| tables_added | Yes | ||
| tables_changed | Yes | ||
| tables_removed | Yes |