Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Maintain this server? Claim it
Call this server's tools from your browser. Nothing to install.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Analyze Postgres SQL/migrations for destructive operations, locking risk, correctness traps (NULL handling that silently returns wrong results), anti-patterns, and query cost. Returns a deterministic verdict (ok/warn/block) with findings. Pass the optional `schema` argument (your CREATE TABLE/INDEX DDL) to also get EXPLAIN-based cost analysis run on a throwaway scratch Postgres — no separate tool or DB connection needed.
The SQL to analyze (one or more statements).
Optional CREATE TABLE/INDEX DDL. Providing it enables EXPLAIN-based cost analysis (seq scans on large tables, etc.) on a throwaway scratch Postgres; omit it for static safety analysis only.
Optional map of table name to estimated row count for realistic cost estimates.
This tool isn't marked read-only, so it may change something on the server or in an account you connected.
Analyze Postgres SQL/migrations for destructive operations, locking risk, correctness traps (NULL handling that silently returns wrong results), anti-patterns, and query cost. Returns a deterministic verdict (ok/warn/block) with findings. Pass the optional `schema` argument (your CREATE TABLE/INDEX DDL) to also get EXPLAIN-based cost analysis run on a throwaway scratch Postgres — no separate tool or DB connection needed.
| Argument | Type | Description |
|---|---|---|
| sql* | string | The SQL to analyze (one or more statements). |
| schema | string | Optional CREATE TABLE/INDEX DDL. Providing it enables EXPLAIN-based cost analysis (seq scans on large tables, etc.) on a throwaway scratch Postgres; omit it for static safety analysis only. |
| dialect | string | |
| rowCountHints | object | Optional map of table name to estimated row count for realistic cost estimates. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "The SQL to analyze (one or more statements)."
},
"schema": {
"type": "string",
"description": "Optional CREATE TABLE/INDEX DDL. Providing it enables EXPLAIN-based cost analysis (seq scans on large tables, etc.) on a throwaway scratch Postgres; omit it for static safety analysis only."
},
"dialect": {
"type": "string",
"const": "postgres"
},
"rowCountHints": {
"type": "object",
"description": "Optional map of table name to estimated row count for realistic cost estimates.",
"additionalProperties": {
"type": "number"
}
}
},
"additionalProperties": false
}Return the custom org policy set currently stored for your Pro key — the same rules analyze_sql enforces on top of the built-ins. Read-only; returns an empty list if none are set. Use set_policies to change them.
No arguments.
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {}
}Replace the stored custom org policy set for your Pro key (this is also how you update or clear them: send the full new set to update, or an empty array to remove all). Each policy blocks or warns on an operation against matching tables (e.g. no DELETE on payments). Policies are declarative data — validated, never executed — and apply transparently to every later analyze_sql call made with this key. Use get_policies to read the current set.
| Argument | Type | Description |
|---|---|---|
| policies* | array | The full policy set (replaces any previously stored set; max 50). |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"policies"
],
"properties": {
"policies": {
"type": "array",
"items": {
"type": "object",
"required": [
"table",
"operations",
"action"
],
"properties": {
"table": {
"type": "string",
"description": "Exact table name or glob, e.g. \"payments\", \"audit_*\", \"*\"."
},
"action": {
"enum": [
"block",
"warn"
],
"type": "string"
},
"message": {
"type": "string",
"description": "Optional human message shown in the finding."
},
"operations": {
"type": "array",
"items": {
"enum": [
"select",
"insert",
"update",
"delete",
"truncate",
"drop",
"alter"
],
"type": "string"
},
"description": "Operations this rule applies to."
}
},
"additionalProperties": false
},
"description": "The full policy set (replaces any previously stored set; max 50)."
}
},
"additionalProperties": false
}