Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

PostgreSQL MCP Server

A Model Context Protocol (MCP) server for PostgreSQL database management and analysis. This server provides comprehensive tools for exploring database schemas, executing queries, analyzing performance, and monitoring database health.


Installation

npm install -g postgres-mcp-server

Or run directly with npx:

npx postgres-mcp-server

Related MCP server: Postgres MCP Server

Configuration

Configure each server using PG_* environment variables. The suffix (_1, _2, _DEV, _PROD, …) can be any string — the server is detected by the presence of PG_NAME_*.

PG_NAME_1="prod"
PG_HOST_1="prod.example.com"
PG_PORT_1="5432"
PG_USERNAME_1="user"
PG_PASSWORD_1="pass"
PG_DATABASE_1="mydb"
PG_SSL_1="true"
PG_DEFAULT_1="true"
PG_ACCESS_MODE_1="readonly"
PG_DB_ACCESS_MODES_1="analytics:full,staging:rw"

Environment Variable Reference:

Variable

Required

Description

PG_NAME_{n}

Yes

Server name (used to identify the server)

PG_HOST_{n}

Yes

PostgreSQL server hostname

PG_PORT_{n}

No

Port number (default: "5432")

PG_USERNAME_{n}

Yes

Database username

PG_PASSWORD_{n}

No

Database password

PG_DATABASE_{n}

No

Default database (default: "postgres")

PG_SCHEMA_{n}

No

Default schema (default: "public")

PG_SSL_{n}

No

SSL mode: true, false, require, prefer, allow, disable

PG_DEFAULT_{n}

No

Set to true to make this the default server on startup

PG_CONTEXT_{n}

No

AI context/guidance for this server (see below)

PG_ACCESS_MODE_{n}

No

Server-wide access mode: readonly / full (overrides POSTGRES_ACCESS_MODE)

PG_DB_ACCESS_MODES_{n}

No

Per-DB access mode overrides: dbname:mode,dbname:mode (e.g. analytics:full)

AI Context for Servers

PG_CONTEXT_{n} provides guidance to AI agents about how to interact with each server. The context is returned in list_servers and get_current_connection responses so AI agents can adjust their behavior accordingly.

PG_CONTEXT_DEV="Development environment. Safe to run any queries. Contains test data only."
PG_CONTEXT_STAGING="Staging with production-like data. Use LIMIT clauses. Avoid bulk operations."
PG_CONTEXT_PROD="PRODUCTION DATABASE - CRITICAL GUIDELINES:
- Read-only queries strongly preferred
- Always use LIMIT (max 1000 rows)
- Avoid full table scans on large tables (users, orders, events)
- Peak hours: 9am-5pm EST - minimize heavy queries
- Main schemas: 'app' (application data), 'analytics' (reporting)
- Contact DBA before any DDL operations"

Access Mode Configuration

Access modes control whether write operations are allowed. Configure at three levels with the following priority:

Priority: Database-level > Server-level > Global > default (full)

# Global default for all servers (optional)
POSTGRES_ACCESS_MODE="readonly"   # full | readonly

# Server-level override (recommended for production)
PG_ACCESS_MODE_1="readonly"

# Per-database override (most specific). Format: dbname:mode,dbname:mode
PG_DB_ACCESS_MODES_1="production:readonly,analytics:full,staging:rw"

Supported values:

  • full / rw / readwrite — allows all SQL operations

  • readonly / ro / read-only — only SELECT and read operations allowed

Claude Code CLI

claude mcp add-json postgres_dbs --scope user '{
  "command": "npx",
  "args": ["-y", "@tejasanik/postgres-mcp-server"],
  "env": {
    "PG_NAME_1": "prod",
    "PG_HOST_1": "prod.example.com",
    "PG_PORT_1": "5432",
    "PG_USERNAME_1": "user",
    "PG_PASSWORD_1": "pass",
    "PG_DATABASE_1": "mydb",
    "PG_SSL_1": "true",
    "PG_DEFAULT_1": "true",
    "PG_ACCESS_MODE_1": "readonly",
    "PG_DB_ACCESS_MODES_1": "analytics:full,staging:rw"
  }
}'

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["@tejasanik/postgres-mcp-server"],
      "env": {
        "PG_NAME_1": "prod",
        "PG_HOST_1": "prod.example.com",
        "PG_PORT_1": "5432",
        "PG_USERNAME_1": "user",
        "PG_PASSWORD_1": "pass",
        "PG_DATABASE_1": "mydb",
        "PG_SSL_1": "true",
        "PG_DEFAULT_1": "true",
        "PG_ACCESS_MODE_1": "readonly",
        "PG_DB_ACCESS_MODES_1": "analytics:full,staging:rw"
      }
    }
  }
}

Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.postgres]
command = "npx"
args = ["-y", "@tejasanik/postgres-mcp-server"]

[mcp_servers.postgres.env]
PG_NAME_1 = "prod"
PG_HOST_1 = "prod.example.com"
PG_PORT_1 = "5432"
PG_USERNAME_1 = "user"
PG_PASSWORD_1 = "pass"
PG_DATABASE_1 = "mydb"
PG_SSL_1 = "true"
PG_DEFAULT_1 = "true"
PG_ACCESS_MODE_1 = "readonly"
PG_DB_ACCESS_MODES_1 = "analytics:full,staging:rw"

Available Tools

Server & Database Management

list_servers

Lists all configured PostgreSQL servers. Returns server names, hosts, ports, and connection status. Use this first to discover available servers.

Parameters:

  • filter (optional): Filter servers by name or host (case-insensitive partial match)

Returns:

  • servers: Array of server information (name, isConnected, isDefault, defaultDatabase, defaultSchema)

  • currentServer: Currently connected server name (or null)

  • currentDatabase: Currently connected database (or null)

  • currentSchema: Current schema (or null)

Note: Host and port are intentionally hidden from responses for security.

list_databases

Lists databases in a specific PostgreSQL server. Always provide the server name to avoid confusion.

Parameters:

  • serverName (required): Name of the server to list databases from. Use list_servers to see available servers.

  • filter (optional): Filter databases by name (case-insensitive partial match)

  • includeSystemDbs (optional): Include system databases (template0, template1). Default: false

  • maxResults (optional): Maximum number of databases to return (default: 50, max: 200)

Returns:

  • serverName: The server name that was queried

  • databases: Array of database information (name, owner, encoding, size)

  • currentDatabase: Currently connected database on this server (or null)

switch_server_db

Switch to a different PostgreSQL server and optionally a specific database and schema.

Parameters:

  • server (required): Name of the server to connect to

  • database (optional): Name of the database to connect to (uses server's defaultDatabase or "postgres")

  • schema (optional): Default schema to use (uses server's defaultSchema or "public")

Returns:

  • success: Whether the switch was successful

  • message: Success message

  • currentServer: Name of the connected server

  • currentDatabase: Name of the connected database

  • currentSchema: Name of the current schema

  • context: (If configured) AI context/guidance for the connected server

get_current_connection

Returns details about the current database connection including server, database, schema, access mode, user, and AI context.

Parameters: None

Returns:

  • isConnected: Whether currently connected to a database

  • server: Current server name

  • database: Current database name

  • schema: Current schema name

  • accessMode: "readonly" or "full"

  • user: Database username for the current connection

  • context: (If configured) AI context/guidance for the current server

Schema & Object Exploration

list_schemas

Lists all database schemas in the current PostgreSQL database.

Parameters:

  • includeSystemSchemas (optional): Include system schemas

  • server, database, schema (optional): One-time connection override

list_objects

Lists database objects within a specified schema.

Parameters:

  • schema (required): Schema name to list objects from

  • objectType (optional): Type of objects to list (table, view, sequence, extension, all)

  • filter (optional): Filter objects by name

  • server, database, targetSchema (optional): One-time connection override

get_object_details

Provides detailed information about a database object including columns, constraints, indexes, size, and row count. Auto-detects whether the target is a table, view, materialized view, or sequence and adapts the response accordingly. Returns exists: false early when the object isn't found.

Parameters:

  • schema (required): Schema name containing the object

  • objectName (required): Name of the object

  • objectType (optional): Type of the object (table, view, matview, sequence, extension). Auto-detected from pg_class.relkind when omitted.

  • server, database, targetSchema (optional): One-time connection override

Returns (varies by detected kind):

  • exists: Whether the object was found.

  • detectedKind: The actual kind detected (table / view / matview / sequence).

  • columns, constraints (incl. check_clause for CHECK constraints), indexes, size, rowCount: For relations.

  • definition: For views and materialized views.

  • sequenceDetails: For sequences (start, min/max, cache, last value).

describe_table

v3 single-call table summary. Replaces the ~5-call dance of get_object_details + COUNT(*) + LIMIT 5 + pg_stats. Returns columns (with null %, distinct ratio from pg_stats), primary key, foreign keys going OUT (this table → others), foreign keys coming IN (others → this table), all indexes with definitions, table size, row-count estimate, and a sample of rows.

Parameters:

  • table (required): Unqualified table name.

  • schema (optional): Default 'public'.

  • sample_size (optional): Number of sample rows to fetch (default 5; 0 to skip).

  • profile_columns (optional): Columns to profile (default: all up to 20).

  • server, database, override_schema (optional): One-time connection override.

find_dependents

Walks pg_depend recursively to find every database object that depends on a target — views, foreign keys, functions, materialized views, indexes, rules. Use BEFORE DROP CASCADE to understand the blast radius. Each dependent is returned flat with its depth from the target (1 = direct, 2 = depends on a depth-1 dependent, …). Sets truncatedAtDepth: true if the recursion limit was hit.

Parameters:

  • name (required): Object name.

  • kind (optional): table/view/matview/sequence/index/function/procedure/type/extension/schema (default table).

  • schema (optional): Default 'public'.

  • max_depth (optional): Recursion limit (1-10, default 5).

  • server, database, override_schema (optional): One-time connection override.

Query Execution

execute_sql

Executes SQL statements on the database. Supports pagination and parameterized queries. Read-only mode prevents write operations.

Parameters:

  • sql (required): SQL statement(s) to execute. Use $1, $2, etc. for parameterized queries.

  • params (optional): Array of parameters for parameterized queries (e.g., [123, "value"]). Prevents SQL injection. Not supported with allowMultipleStatements.

  • maxRows (optional): Maximum rows to return (default: 1000, max: 100000). Use with offset for pagination.

  • offset (optional): Number of rows to skip for pagination (default: 0).

  • allowLargeScript (optional): Set to true to bypass the 100KB SQL length limit for deployment scripts.

  • includeSchemaHint (optional): Include schema information (columns, primary keys, foreign keys) for tables referenced in the query.

  • allowMultipleStatements (optional): Allow multiple SQL statements separated by semicolons. Returns results for each statement with line numbers.

  • transactionId (optional): Execute within an active transaction. Get this from begin_transaction.

  • maxEstimatedRows (optional): Query-budget pre-flight check. If the planner estimates more rows than this, the query is refused without executing. Only applies to SELECT.

  • maxEstimatedCost (optional): Query-budget pre-flight check. If the planner estimates a higher cost than this, the query is refused without executing. Only applies to SELECT.

  • server, database, schema (optional): One-time connection override. Execute on a different server/database/schema without changing the main connection. Cannot be used with transactionId.

Returns:

  • rows: Result rows (paginated)

  • rowCount: Total number of rows in the result

  • fields: Column names

  • executionTimeMs: Query execution time in milliseconds

  • offset: Current offset

  • hasMore: Whether more rows are available

  • outputFile: (Only if output is too large) Path to temp file with full results

  • schemaHint: (When includeSchemaHint=true) Schema information for referenced tables:

    • tables: Array of table schemas with columns, primary keys, foreign keys, and row count estimates

Note: Large outputs are automatically written to a temp file, and the file path is returned. This prevents token wastage when dealing with large result sets.

execute_sql_file

Executes a .sql file from the filesystem. Useful for running migration scripts, schema changes, or data imports. Supports SQL files from various tools like Liquibase, Flyway, and SQL Server migrations.

Parameters:

  • filePath (required): Absolute or relative path to the .sql file to execute

  • useTransaction (optional): Wrap execution in a transaction (default: true). If any statement fails, all changes are rolled back.

  • stopOnError (optional): Stop execution on first error (default: true). If false, continues with remaining statements and collects all errors.

  • stripPatterns (optional): Array of patterns to remove from SQL before execution. Useful for stripping tool-specific delimiters (e.g., Liquibase's /, SQL Server's GO).

  • stripAsRegex (optional): If true, treat stripPatterns as regular expressions; if false, as literal strings (default: false).

  • validateOnly (optional): If true, parse and validate the file without executing (default: false). Returns a preview of all statements.

Returns:

  • success: Whether all statements executed successfully

  • filePath: Resolved file path

  • fileSize: File size in bytes

  • totalStatements: Total executable statements in the file

  • statementsExecuted: Number of successfully executed statements

  • statementsFailed: Number of failed statements

  • executionTimeMs: Total execution time in milliseconds

  • rowsAffected: Total rows affected by all statements

  • errors: (When stopOnError=false) Array of error details:

    • statementIndex: Which statement failed (1-based)

    • sql: The failing SQL (truncated to 200 chars)

    • error: Error message

  • rollback: Whether a rollback was performed

  • validateOnly: (When validateOnly=true) Set to true

  • preview: (When validateOnly=true) Array of statement previews:

    • index: Statement index (1-based)

    • lineNumber: Line number in the file

    • sql: The SQL statement (truncated to 200 chars)

    • type: Detected statement type (SELECT, INSERT, UPDATE, DELETE, CREATE, etc.)

Limits: Max file size: 50MB. Supports PostgreSQL-specific syntax including dollar-quoted strings and block comments.

Examples:

# Preview a file without executing
execute_sql_file({ filePath: "/path/to/migration.sql", validateOnly: true })

# Strip Liquibase delimiters (literal "/" on its own line)
execute_sql_file({ filePath: "/path/to/liquibase.sql", stripPatterns: ["/"] })

# Strip SQL Server GO statements (regex pattern)
execute_sql_file({
  filePath: "/path/to/sqlserver.sql",
  stripPatterns: ["^\\s*GO\\s*$"],
  stripAsRegex: true
})

# Strip multiple patterns
execute_sql_file({
  filePath: "/path/to/migration.sql",
  stripPatterns: ["/", "GO", "\\"]
})

preview_sql_file

Preview a SQL file without executing it. Similar to mutation_preview but for SQL files. Shows statement counts by type and warnings for potentially dangerous operations. Use this before execute_sql_file to understand what a migration will do.

Parameters:

  • filePath (required): Absolute or relative path to the .sql file to preview

  • stripPatterns (optional): Patterns to strip from SQL before parsing (same as execute_sql_file)

  • stripAsRegex (optional): If true, treat patterns as regex (default: false)

  • maxStatements (optional): Maximum statements to show in preview (default: 20, max: 100)

Returns:

  • filePath: Resolved file path

  • fileSize: File size in bytes

  • fileSizeFormatted: Human-readable file size (e.g., "15.2 KB")

  • totalStatements: Total executable statements in the file

  • statementsByType: Breakdown by statement type (e.g., { "CREATE": 5, "INSERT": 10, "ALTER": 2 })

  • statements: Array of statement previews (up to maxStatements):

    • index: Statement number (1-based)

    • lineNumber: Line number in file

    • sql: Statement SQL (truncated to 300 chars)

    • type: Statement type (SELECT, INSERT, CREATE, etc.)

  • warnings: Array of warnings for dangerous operations:

    • DROP statements

    • TRUNCATE statements

    • DELETE/UPDATE without WHERE clause

  • summary: Human-readable summary (e.g., "File contains 17 statements: 10 INSERT, 5 CREATE, 2 ALTER")

Example:

preview_sql_file({ filePath: "/path/to/migration.sql" })
// Returns:
// {
//   "filePath": "/path/to/migration.sql",
//   "fileSize": 15234,
//   "fileSizeFormatted": "14.9 KB",
//   "totalStatements": 17,
//   "statementsByType": { "CREATE": 5, "INSERT": 10, "ALTER": 2 },
//   "statements": [...],
//   "warnings": ["Statement 15 (line 142): DROP statement detected - will permanently remove database object"],
//   "summary": "File contains 17 statements: 10 INSERT, 5 CREATE, 2 ALTER"
// }

mutation_preview

Preview the effect of INSERT, UPDATE, or DELETE statements without executing them. Shows estimated rows affected and a sample of rows that would be modified. Essential for verifying destructive queries before running them.

Parameters:

  • sql (required): The INSERT, UPDATE, or DELETE statement to preview

  • sampleSize (optional): Number of sample rows to show (default: 5, max: 20)

Returns:

  • mutationType: Type of mutation (INSERT, UPDATE, DELETE)

  • estimatedRowsAffected: Estimated number of rows that would be affected

  • sampleAffectedRows: Sample of rows that would be modified (for UPDATE/DELETE)

  • targetTable: The table being modified

  • whereClause: The WHERE clause from the query (if present)

  • warning: Warning message if no WHERE clause (all rows affected) or for INSERT previews

Example:

mutation_preview({ sql: "DELETE FROM orders WHERE status = 'cancelled'" })
// Returns: { mutationType: "DELETE", estimatedRowsAffected: 150, sampleAffectedRows: [...5 rows...] }

mutation_dry_run

Transaction-based dry-run for mutations. Actually executes the INSERT/UPDATE/DELETE within a transaction, captures REAL results, then ROLLBACK so nothing persists. More accurate than mutation_preview because it catches actual constraint violations, trigger effects, and exact row counts.

Non-Rollbackable Operations: Statements containing explicit NEXTVAL() or SETVAL() are skipped to prevent sequence values from being permanently consumed. For skipped statements, an EXPLAIN query plan is provided instead.

Parameters:

  • sql (required): The INSERT, UPDATE, or DELETE statement to dry-run

  • sampleSize (optional): Number of sample rows to return (default: 10, max: 20)

Returns:

  • mutationType: Type of mutation (INSERT, UPDATE, DELETE)

  • success: Whether the dry-run executed successfully

  • skipped: If true, statement was skipped (contains non-rollbackable operation)

  • skipReason: Why the statement was skipped

  • rowsAffected: Actual number of rows that would be affected

  • beforeRows: Sample of rows before the change (for UPDATE/DELETE)

  • affectedRows: Sample of rows after the change (for INSERT/UPDATE) or deleted rows

  • targetTable: The table being modified

  • whereClause: The WHERE clause (if present)

  • executionTimeMs: Execution time in milliseconds

  • error: Detailed PostgreSQL error information if failed:

    • message: Error message

    • code: PostgreSQL error code (e.g., '23505' for unique violation)

    • detail: Detailed error description

    • hint: Hint for fixing the error

    • constraint: Constraint name that caused the error

    • table, column, schema: Related database objects

  • nonRollbackableWarnings: Warnings about side effects:

    • operation: Type of operation (SEQUENCE, VACUUM, etc.)

    • message: Warning message

    • mustSkip: If true, operation was skipped; if false, just a warning

  • warnings: General warnings (e.g., no WHERE clause)

  • explainPlan: Query plan from EXPLAIN (for skipped DML statements with NEXTVAL/SETVAL)

Example:

mutation_dry_run({ sql: "INSERT INTO users (email) VALUES ('test@test.com')" })
// On success: { success: true, mutationType: "INSERT", rowsAffected: 1, affectedRows: [{id: 5, email: "test@test.com"}] }
// On failure: { success: false, error: { code: "23505", constraint: "users_email_key", detail: "Key already exists" } }

// With explicit NEXTVAL (skipped):
mutation_dry_run({ sql: "INSERT INTO users (id) VALUES (nextval('users_id_seq'))" })
// Returns: { success: true, skipped: true, skipReason: "NEXTVAL increments sequence...", explainPlan: [...] }

dry_run_sql_file

Transaction-based dry-run for SQL files. Actually executes ALL statements within a transaction, captures REAL results for each statement (row counts, errors with line numbers, constraint violations), then ROLLBACK so nothing persists. Perfect for testing migrations before deploying.

Non-Rollbackable Operations: The following operations are automatically skipped (not executed):

  • VACUUM, CLUSTER, REINDEX CONCURRENTLY: Cannot run inside a transaction

  • CREATE INDEX CONCURRENTLY: Cannot run inside a transaction

  • CREATE/DROP DATABASE: Cannot run inside a transaction

  • NEXTVAL(), SETVAL(): Would permanently consume sequence values

For skipped DML statements (INSERT/UPDATE/DELETE/SELECT with NEXTVAL/SETVAL), an EXPLAIN query plan is provided so you can still see what the query would do.

Parameters:

  • filePath (required): Absolute or relative path to the .sql file

  • stripPatterns (optional): Patterns to strip from SQL before execution (e.g., ["/"] for Liquibase)

  • stripAsRegex (optional): If true, treat patterns as regex (default: false)

  • maxStatements (optional): Maximum statements to include in results (default: 50, max: 200)

  • stopOnError (optional): Stop on first error (default: false - continues to show ALL errors)

Returns:

  • success: Whether all statements executed successfully (skipped statements don't count as failures)

  • filePath: Resolved file path

  • fileSize: File size in bytes

  • fileSizeFormatted: Human-readable file size

  • totalStatements: Total statements in file

  • successCount: Number of successful statements

  • failureCount: Number of failed statements

  • skippedCount: Number of skipped statements (non-rollbackable operations)

  • totalRowsAffected: Total rows affected across all statements

  • statementsByType: Breakdown by statement type (e.g., {"CREATE": 5, "INSERT": 10})

  • executionTimeMs: Total execution time

  • statementResults: Array of results for each statement:

    • index: Statement number (1-based)

    • lineNumber: Line number in file

    • sql: The SQL statement (truncated)

    • type: Statement type (SELECT, INSERT, CREATE, etc.)

    • success: Whether statement succeeded

    • skipped: If true, statement was skipped (non-rollbackable operation)

    • skipReason: Why the statement was skipped

    • rowCount: Rows affected/returned

    • rows: Sample rows (for SELECT or RETURNING)

    • executionTimeMs: Statement execution time

    • error: Detailed PostgreSQL error if failed (same fields as mutation_dry_run)

    • warnings: Warnings for this statement

    • explainPlan: Query plan from EXPLAIN (for skipped DML statements)

  • nonRollbackableWarnings: Warnings about operations that can't be fully rolled back:

    • operation: Type (SEQUENCE, VACUUM, CLUSTER, etc.)

    • message: Warning message

    • mustSkip: If true, operation was skipped; if false, just a warning

    • statementIndex, lineNumber: Location in file

  • summary: Human-readable summary

  • rolledBack: Always true - confirms changes were rolled back

Example:

dry_run_sql_file({ filePath: "/path/to/migration.sql", stripPatterns: ["/"] })
// Returns:
// {
//   "success": false,
//   "totalStatements": 15,
//   "successCount": 12,
//   "failureCount": 2,
//   "skippedCount": 1,
//   "statementResults": [
//     { "index": 1, "lineNumber": 1, "type": "CREATE", "success": true },
//     { "index": 5, "lineNumber": 23, "type": "INSERT", "success": false,
//       "error": { "code": "23505", "constraint": "users_pkey", "detail": "Key already exists" } },
//     { "index": 8, "lineNumber": 45, "type": "SELECT", "success": true, "skipped": true,
//       "skipReason": "NEXTVAL increments sequence...", "explainPlan": [...] },
//     ...
//   ],
//   "nonRollbackableWarnings": [
//     { "operation": "SEQUENCE", "message": "INSERT may consume sequence values...", "mustSkip": false },
//     { "operation": "SEQUENCE", "message": "NEXTVAL increments sequence...", "mustSkip": true }
//   ],
//   "summary": "Dry-run of 15 statements: 12 succeeded, 2 failed, 1 skipped (non-rollbackable). All changes rolled back.",
//   "rolledBack": true
// }

When to use dry_run_sql_file vs preview_sql_file:

Feature

preview_sql_file

dry_run_sql_file

Speed

Fast (just parsing)

Slower (actual execution)

Detects syntax errors

Basic

Actual PostgreSQL errors

Detects constraint violations

No

Yes

Detects trigger effects

No

Yes

Accurate row counts

No (estimates)

Yes (actual)

Shows error details

No

Yes (code, constraint, hint)

Consumes sequences

No

No (NEXTVAL/SETVAL skipped)

Shows query plan for skipped ops

N/A

Yes (EXPLAIN)

batch_execute

Execute multiple SQL queries in parallel. Returns all results keyed by query name. Efficient for fetching multiple independent pieces of data in a single call.

Parameters:

  • queries (required): Array of queries to execute (max 20):

    • name: Unique name for this query (used as key in results)

    • sql: SQL query to execute

    • params (optional): Query parameters

  • stopOnError (optional): Stop on first error (default: false, continues with all queries)

Returns:

  • totalQueries: Total number of queries in the batch

  • successCount: Number of successful queries

  • failureCount: Number of failed queries

  • totalExecutionTimeMs: Total execution time in milliseconds

  • results: Object with query results keyed by name:

    • success: Whether the query succeeded

    • rows: Result rows (if successful)

    • rowCount: Number of rows returned

    • error: Error message (if failed)

    • executionTimeMs: Individual query execution time

Example:

batch_execute({
  queries: [
    { name: "user_count", sql: "SELECT COUNT(*) FROM users" },
    { name: "order_total", sql: "SELECT SUM(total) FROM orders" },
    { name: "recent_signups", sql: "SELECT COUNT(*) FROM users WHERE created_at > NOW() - INTERVAL '7 days'" }
  ]
})
// Returns all three results in parallel, keyed by name

Transaction Control

begin_transaction

Start a new database transaction. Returns a transactionId to use with execute_sql, commit_transaction, or rollback_transaction.

Parameters: None

Returns:

  • transactionId: Unique ID for this transaction

  • status: "started"

  • message: Instructions for using the transaction

commit_transaction

Commit an active transaction, making all changes permanent.

Parameters:

  • transactionId (required): The transaction ID returned by begin_transaction

rollback_transaction

Rollback an active transaction, undoing all changes made within it.

Parameters:

  • transactionId (required): The transaction ID returned by begin_transaction

Example - Transaction Usage:

1. Call begin_transaction to get a transactionId
2. Call execute_sql with transactionId for each statement
3. Call commit_transaction to save changes, OR rollback_transaction to undo

explain_query

Gets the execution plan for a SQL query.

Parameters:

  • sql (required): SQL query to explain

  • analyze (optional): Execute query to get real timing

  • buffers (optional): Include buffer usage statistics

  • format (optional): Output format (text, json, yaml, xml)

  • hypotheticalIndexes (optional): Simulate indexes (requires hypopg extension)

  • server, database, schema (optional): One-time connection override (see below)

Connection Override (One-Time Execution)

Most query execution tools support one-time connection override parameters that allow executing a query on a different server/database/schema without changing the main connection. This is useful for:

  • Querying multiple databases in a single workflow

  • Running read queries against a replica while keeping the main connection to primary

  • Comparing schemas across different servers

Supported tools: execute_sql, explain_query, list_schemas, list_objects, get_object_details, describe_table, find_dependents, execute_sql_file, mutation_preview, mutation_dry_run, dry_run_sql_file, batch_execute, lock_check, detect_migration_state, column_profile, generate_seed_data, find_blocking_queries, kill_query, export_to_sql_file

Override Parameters:

  • server (optional): Execute on this server instead of the current one

  • database (optional): Execute on this database instead of the current one

  • schema (optional): Set search_path to this schema for this execution only

Important Notes:

  1. The main connection remains unchanged after the query completes

  2. Connection override cannot be used with transactions (transactionId)

  3. Override connections use a separate connection pool with LRU eviction

  4. Maximum 10 cached override pools, each limited to 2 connections

  5. Total connections across all pools limited to 50

Examples:

# Query another database without switching
execute_sql({
  sql: "SELECT * FROM users LIMIT 10",
  database: "analytics_db"
})

# Query a different server entirely
execute_sql({
  sql: "SELECT COUNT(*) FROM orders",
  server: "reporting",
  database: "warehouse"
})

# List schemas on a different server
list_schemas({
  server: "production",
  database: "myapp"
})

# Compare table structure across environments
get_object_details({
  schema: "public",
  objectName: "users",
  server: "staging"
})

Connection Pool Management:

Override connections are managed efficiently:

  • Pools are cached and reused for repeated queries to the same server/database

  • LRU eviction removes oldest pools when limit (10) is reached

  • Connections are properly released after each query

  • Global connection limit prevents resource exhaustion

Performance Analysis

get_top_queries

Reports the slowest SQL queries based on execution time.

Parameters:

  • limit (optional): Number of queries to return (default: 10)

  • orderBy (optional): Order by total_time, mean_time, or calls

  • minCalls (optional): Minimum number of calls to include

Requires: pg_stat_statements extension

analyze_workload_indexes

Analyzes database workload and recommends optimal indexes.

Parameters:

  • topQueriesCount (optional): Number of top queries to analyze

  • includeHypothetical (optional): Include hypothetical index analysis

analyze_query_indexes

Analyzes specific SQL queries and recommends indexes.

Parameters:

  • queries (required): Array of SQL queries to analyze (max 10)

DDL Safety & Migration

lock_check

Static analysis of a SQL statement to determine the PostgreSQL lock level it will require, whether it forces a full-table rewrite, and an estimated duration based on the target table's current size. Knows lock semantics for ALTER TABLE variants, CREATE/DROP INDEX (concurrent vs not), VACUUM, CLUSTER, REFRESH MATERIALIZED VIEW, and more. Returns warnings for ACCESS EXCLUSIVE locks on busy production tables and concrete recommendations (e.g., use CREATE INDEX CONCURRENTLY, NOT VALID + VALIDATE CONSTRAINT, etc.).

Parameters:

  • sql (required): DDL statement to analyze.

  • estimate_duration (optional): Look up target table size to estimate duration. Default true.

  • server, database, schema (optional): One-time connection override.

safe_alter_table

Convert a high-level intent into a multi-step zero-downtime DDL recipe. Each step has its own SQL, expected lock level, and notes. Pipe the resulting scriptSql through dry_run_sql_file for verification, then through execute_sql_file({ useTransaction: false }) for the production rollout (CONCURRENTLY operations cannot run inside a transaction).

Supported intents:

  • add_not_null_column_with_default — backfill before flipping NOT NULL.

  • add_not_nullNOT VALID then VALIDATE CONSTRAINT.

  • add_foreign_keyNOT VALID then VALIDATE.

  • add_checkNOT VALID then VALIDATE.

  • create_indexCREATE INDEX CONCURRENTLY (with allowlisted index method: btree / hash / gist / spgist / gin / brin).

  • drop_indexDROP INDEX CONCURRENTLY.

Parameters:

  • intent (required): { kind, ... } — see intent list above.

detect_migration_state

Probe the database for migration tool tracker tables (Liquibase, Flyway, Alembic, Prisma, Knex, Sequelize, Django, Rails, Goose, TypeORM). Returns which tools are detected, the schema and table holding their state, the count of applied migrations, and the latest version. Use this first to learn whether a DB is managed by a migration tool before suggesting changes.

Parameters:

  • schemas (optional): Schemas to probe (default: all non-system schemas).

  • server, database, schema (optional): One-time connection override.

Cross-Database Operations

export_to_sql_file

Export schema (DDL) and/or data from the connected database to a .sql file. The header banner records timestamp and source server alias (host/port hidden). Use this before transfer_objects or for migration-script generation.

Parameters:

  • filePath (required): Path to the .sql file. Must end with .sql.

  • mode (optional): 'append' (default — preserves existing content with a separator banner) or 'overwrite'.

  • what (required): One of:

    • { kind: 'objects', objects: [{ kind, name, schema? }, ...] } — DDL of an explicit list, topologically ordered by dependency.

    • { kind: 'data', tables, where?, orderBy?, limit? } — INSERT statements for tables.

    • { kind: 'schema_dump', schema?, include_data? } — full schema, optionally with data.

    • { kind: 'query_result', sql, target_table } — SELECT result emitted as INSERTs into a target table.

  • confirm_overwrite (optional): When mode='overwrite' and the file was modified <60s ago, set true to confirm. Foot-gun guard.

  • server, database, schema (optional): One-time connection override.

transfer_objects

Transfer DDL and/or data from one configured server/database to another (same server, different DB, or fully remote). Both endpoints must be configured servers (PG_NAME_*); ad-hoc connection strings are not accepted (security). Refuses if the target's effective access mode is readonly. FK constraints between tables are emitted as ALTER TABLE statements appended after tables to handle inter-table dependency cycles.

Parameters:

  • from, to (required): { server, database?, schema? } source and target endpoints.

  • objects (required): '*' (all objects in source schema) or array of { kind, name, schema? }.

  • include (optional): 'ddl' / 'data' / 'both' (default).

  • if_exists (optional): 'skip' / 'replace' / 'error' (default — fails fast).

  • dry_run (optional): Generate SQL without applying. Use with output_file.

  • output_file (optional): Path to write generated SQL when dry_run: true.

schema_diff

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 converges the target with the source. Source is the source of truth.

Parameters:

  • source, target (required): { server, database?, schema? }.

Data Generation & Profiling

column_profile

Single-pass profile per column: null %, distinct count, top-K values with frequencies, min/max, and type-aware stats (avg/stddev for numeric, length distribution for text, range for temporal). Uses TABLESAMPLE BERNOULLI for tables larger than sample_threshold (default 1M rows) to keep latency bounded.

Parameters:

  • table (required), schema (optional, default 'public').

  • columns (optional): Specific columns to profile (default: all up to 30).

  • sample_percent (optional): Default 10.

  • sample_threshold (optional): Default 1_000_000 rows.

  • top_k (optional): Top-K values per column (default 10, max 25).

  • server, database, override_schema (optional): One-time connection override.

generate_seed_data

Generate schema-aware fake seed data for a table. Respects NOT NULL, UNIQUE/PK (with retry-with-collision-suffix), enum types (cycles through labels), defaults, text length limits, and FK columns (skipped or filled — caller's choice). Generates type-appropriate values for numeric, text, boolean, uuid, date/timestamp, bytea, JSON, inet, cidr, macaddr.

Parameters:

  • table (required), schema (optional, default 'public').

  • count (required): 1 to 100,000.

  • column_values (optional): Per-column SQL value override, e.g. { country: "'US'", priority: '1' }. Quoted as PG literals.

  • skip_fks (optional): Default false.

  • apply (optional): Apply directly to DB (default true) or return SQL only (false).

  • server, database, override_schema (optional): One-time connection override.

Operational Tools

find_blocking_queries

Show currently-blocking sessions in a friendly tree (blocker → blocked) using pg_stat_activity ⨝ pg_blocking_pids(). Returns each session's pid, user, database, application name, state, current query, time in state, and wait_event. Use to diagnose slowdowns and pick a candidate for kill_query.

Parameters:

  • include_idle (optional): Default true.

  • limit (optional): Default 50.

  • server, database, schema (optional): One-time connection override.

kill_query

Cancel or terminate a backend session by PID. Returns a snapshot of the target session before signaling.

Parameters:

  • pid (required): Backend PID to signal.

  • mode (required): 'cancel' (soft — pg_cancel_backend, interrupts current statement) or 'terminate' (hard — pg_terminate_backend, kills the entire backend).

  • confirm (required): Must be true. Foot-gun guard.

  • server, database, schema (optional): One-time connection override.

Note: Refused if the target server's effective access mode is readonly.

Health Monitoring

analyze_db_health

Performs comprehensive database health checks including:

  • Buffer Cache Hit Rate: Checks cache efficiency

  • Connection Health: Monitors connection usage

  • Invalid Indexes: Detects broken indexes

  • Unused Indexes: Identifies indexes that aren't being used

  • Duplicate Indexes: Finds redundant indexes

  • Vacuum Health: Monitors dead tuple ratios

  • Sequence Limits: Warns about sequences approaching limits

  • Constraint Validation: Checks for unvalidated constraints

Usage Examples

Connect to a Server and List Databases

1. Use list_servers to see available servers
2. Use list_databases with serverName="dev" to see databases in the dev server
3. Use switch_server_db with server="dev", database="myapp" to connect

Explore Database Schema

1. Use list_schemas to see all schemas
2. Use list_objects with schema="public" to see tables
3. Use get_object_details with schema="public", objectName="users" to see table structure

Analyze Query Performance

1. Use explain_query with your SQL to see the execution plan
2. Use get_top_queries to find slow queries
3. Use analyze_query_indexes to get index recommendations

Health Check

1. Use analyze_db_health to run all health checks
2. Review warnings and critical issues
3. Take action on recommendations

Execute SQL Migration File

1. Use execute_sql_file with filePath="/path/to/migration.sql"
2. By default, runs in a transaction - all changes rolled back on error
3. Set stopOnError=false to continue on errors and get a full report
4. Set useTransaction=false for DDL statements that can't run in transactions

Features

Auto-Reconnect on Connection Errors

The server automatically handles stale database connections. When a connection error occurs (e.g., server went inactive, connection reset, timeout), the server will:

  1. Detect the connection error

  2. Invalidate the stale connection

  3. Automatically reconnect using the stored server/database/schema

  4. Retry the operation once

This is particularly useful for:

  • Staging/development servers that go idle

  • Cloud databases with connection timeouts

  • Network interruptions

Supported error patterns include: Connection terminated, ECONNRESET, ETIMEDOUT, server closed the connection unexpectedly, and PostgreSQL error codes like 57P01 (admin_shutdown), 08003 (connection_does_not_exist), etc.

Hidden Connection Details

Host URLs, ports, and credentials are never exposed in tool responses. Only server names (aliases) are visible, preventing accidental exposure of infrastructure details.

Connection Context in Responses

All tool responses include a connection object showing which server, database, and schema the operation ran on:

{
  "rows": [...],
  "connection": {
    "server": "production",
    "database": "myapp",
    "schema": "public"
  }
}

Multi-Statement Execution

Execute multiple SQL statements in a single call using allowMultipleStatements: true:

execute_sql({
  sql: "INSERT INTO logs VALUES (1); INSERT INTO logs VALUES (2); SELECT * FROM logs;",
  allowMultipleStatements: true
})

Returns results for each statement with line numbers for easy debugging.

Transaction Support

Explicit transaction control for atomic multi-statement operations:

1. begin_transaction() → returns transactionId
2. execute_sql({ sql: "UPDATE ...", transactionId: "..." })
3. execute_sql({ sql: "INSERT ...", transactionId: "..." })
4. commit_transaction({ transactionId: "..." }) OR rollback_transaction({ transactionId: "..." })

Line Number Tracking

When execute_sql_file or multi-statement execution encounters errors, line numbers are included to help locate issues:

{
  "errors": [
    {
      "statementIndex": 5,
      "lineNumber": 42,
      "sql": "INSERT INTO...",
      "error": "syntax error at or near..."
    }
  ]
}

Security

  • Access Mode: By default, the server runs in full access mode. Configure access at global (POSTGRES_ACCESS_MODE), server (PG_ACCESS_MODE_*), or database (PG_DB_ACCESS_MODES_*) levels. Database-level settings override server-level, which override global. Recommended: set production servers/databases to readonly.

  • SQL Injection Protection: All user inputs are validated and parameterized queries are used where possible.

  • Query Timeout: Default 30-second timeout prevents runaway queries.

  • Credentials: Managed via environment variables and never logged or exposed through the MCP interface.

  • File Permissions: Large output files are created with restricted permissions (0600).

  • Hidden Infrastructure: Host URLs, ports, and passwords are never included in tool responses.

Requirements

  • Node.js 18.0.0 or higher

  • PostgreSQL 11 or higher

  • Optional: pg_stat_statements extension for query performance analysis

  • Optional: hypopg extension for hypothetical index simulation

Development & Testing

The full test suite includes integration tests that exercise the tools against a real PostgreSQL cluster (no mocks). There are two backends:

  1. Local audit cluster (preferred): set AUDIT_PG_URL to a real PG 14+ instance you control. Tests provision per-test databases on it (e.g. audit_iter1_a, audit_sp1, …) so suites are isolated. The cluster is shared across runs and torn down externally.

  2. testcontainers fallback (CI): set POSTGRES_INTEGRATION_TESTS=1 and the suite spins up postgres:16-alpine per test file.

  3. Skipped (default): if neither variable is set, integration tests are silently skipped — unit tests still run.

# Run unit tests only
npm test

# Run against your audit cluster
export AUDIT_PG_URL="postgres://audit_owner:<urlencoded-pw>@127.0.0.1:5433/audit_db"
npm test

# Run only the audit-iteration regression tests
npm test -- --testPathPatterns=audit/iteration

# Run the perf-health deep audit
npm run perfhealth

The audit_owner role on the cluster needs CREATEDB (so each suite can provision its own DB) and CREATEROLE (for test users). It should NOT be a superuser.

🤖 Agent Experience (AX) - Claude Code Review

Tested by: Claude Code (Sonnet 4.5) Use Case: Database deployment, schema exploration, and SQL migration Rating: ⭐⭐⭐⭐⭐ (9.5/10)

What I Loved

1. Clear, Structured Responses Every response includes connection context (server, database, schema), making it crystal clear which environment I'm working in. This is essential when managing multiple databases - I never have to guess where a query ran.

2. Excellent Error Handling When I encountered a syntax error with Liquibase's / delimiter, the error message showed:

  • Exact line number (151)

  • The failing statement

  • Transaction rollback confirmation

This made troubleshooting instant. No digging through logs or guessing what failed.

3. Server Management is Intuitive

  • list_servers → Shows all available servers with connection status

  • list_databases → Filters databases by server name

  • switch_server_db → Seamless switching with immediate confirmation

The flow is natural: discover → select → connect → execute.

4. SQL File Deployment Made Easy The stripPatterns feature solved my exact problem:

execute_sql_file({
  filePath: "/path/to/liquibase.sql",
  stripPatterns: ["/"], // Removes Liquibase delimiters
});

Before this feature, I had to manually remove delimiters or use raw execute_sql. Now it's one clean call.

5. Dry-Run Capabilities are Outstanding dry_run_sql_file is a game-changer:

  • Executes ALL statements in a transaction

  • Shows REAL errors with PostgreSQL error codes and constraint names

  • Automatically skips non-rollbackable operations (VACUUM, NEXTVAL)

  • Provides EXPLAIN plans for skipped statements

  • Then rolls back everything

This is way better than just parsing - I can catch constraint violations, trigger issues, and get exact row counts before deployment.

6. Security by Default

  • Credentials never appear in responses

  • Host/port intentionally hidden (only server names visible)

  • Readonly mode available for production safety

  • Connection context always visible

Improvements Based on My Feedback

The developer implemented several features after I tested the MCP:

SQL File Delimiter Support - Added stripPatterns for Liquibase /, SQL Server GO, etc. ✅ Validate-Only Mode - execute_sql_file({ validateOnly: true }) previews without execution ✅ Enhanced Connection Info - get_current_connection now returns user and AI contextComprehensive Dry-Run - dry_run_sql_file provides real execution + rollback ✅ Better Error Details - PostgreSQL error codes, constraint names, hints included

v3 Additions — Deeper Database Workflow Support

After live audit testing across multiple iterations against a real PG 17 cluster with complex schemas (FKs, partial indexes, materialized views, cycles), v3 adds a layer of high-leverage tools that reduce typical multi-step AI workflows to a single call:

describe_table - Replaces ~5 calls (object details + sample rows + count + pg_stats) with one rich response including FKs both directions. ✅ find_dependents - Walk pg_depend recursively before any DROP CASCADE to see the blast radius. ✅ lock_check - Static analysis of DDL to predict lock level, table-rewrite, and duration. Knows the semantics of ALTER TABLE, CREATE INDEX [CONCURRENTLY], VACUUM, CLUSTER, REFRESH MATERIALIZED VIEW, etc. ✅ safe_alter_table - Convert intent ("add NOT NULL with default", "add FK", "create index", …) into a multi-step zero-downtime DDL recipe with NOT VALID + VALIDATE patterns. ✅ detect_migration_state - Probe for Liquibase, Flyway, Alembic, Prisma, Knex, Sequelize, Django, Rails, Goose, TypeORM tracker tables. Quoted-identifier safe (e.g. catches Sequelize's "SequelizeMeta"). ✅ export_to_sql_file / transfer_objects / schema_diff - First-class cross-database operations: dump, copy, or compare schema/data between configured endpoints. FK constraints emitted as separate ALTER TABLE to handle inter-table cycles. ✅ column_profile - Type-aware column stats with TABLESAMPLE BERNOULLI for tables >1M rows. Replaces a dozen exploratory queries. ✅ generate_seed_data - Schema-aware fake data with NOT NULL, UNIQUE/PK, enum, default, length, and FK awareness. ✅ find_blocking_queries + kill_query - Diagnose lock waits and pg_cancel_backend / pg_terminate_backend with confirmation guard. ✅ Query budget on execute_sql - maxEstimatedRows / maxEstimatedCost refuse the query before execution if the planner says it's too big. ✅ Hardening from audit iterations - per-statement savepoints in dry_run_sql_file (DO-block + embedded COMMIT no longer compromises the dry-run), preserved PG error codes from mutation_dry_run, allowlisted index_type in safe_alter_table, schema validation runs before pool teardown in switch_server_db, detect_migration_state quoted-identifier lookup, findDependents truncatedAtDepth flag actually trips, analyze_db_health reports invalid-index check failures as warning (not silently healthy).

Real-World Experience

Task: Deploy a PostgreSQL function to two databases (dev + analytics)

  1. Discovery: list_servers showed all configured servers

  2. Preview: Used preview_sql_file to check the file structure

  3. Issue: Got syntax error from Liquibase's / delimiter

  4. Solution: Switched to direct execute_sql to bypass the delimiter

  5. Deployment: Successfully deployed to both databases

  6. Verification: Used get_current_connection to confirm each deployment

Total time: ~3 minutes. The structured responses and clear errors made it feel effortless.

Minor Suggestions for Future

  1. Batch Cross Servers Deployment - Deploy same script to multiple servers at once

  2. Recent Connections - Quick-switch to recently used databases

  3. Statement Progress - Show progress for large SQL files (e.g., "Executing statement 15/100...")

Bottom Line

This MCP is production-ready and developer-friendly. The combination of clear responses, robust error handling, and powerful features like dry-run make it an essential tool for database work. The developer clearly understands the needs of both AI agents and human operators.

Recommended for: Database migrations, schema exploration, multi-environment management, and production deployments.


License

MIT

Available Tools

36 tools
analyze_db_healthA

Run comprehensive database health checks: cache hit rates, connection usage, index health (invalid/unused/duplicate), vacuum status, sequence limits, unvalidated constraints. Returns issues with severity levels.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

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

Lists checks performed and mentions outputs issues with severity levels, but does not disclose behavioral traits beyond that (e.g., whether it's safe to run frequently, required permissions, or if any side effects occur). With no annotations, description carries the burden, and fails to fully address safety or impact.

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?

Single sentence with bullet-like listing of checks; no wasted words, front-loaded with purpose. Highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a comprehensive health check with no input parameters and no output schema, the description could elaborate on the output format or scope (e.g., which database/table scope). It lists checks but omits any detail on how results are structured, leaving the agent to infer. Adequate but incomplete.

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?

No parameters exist, so schema coverage is trivially 100%. Description adds value by explaining what the tool does, meeting baseline for zero-parameter tools. No further param context needed.

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?

Description clearly states 'Run comprehensive database health checks' and enumerates specific checks (cache hit rates, connection usage, index health, etc.), differentiating from sibling tools like analyze_query_indexes which focus on specific index analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternative analysis tools (e.g., analyze_query_indexes, analyze_workload_indexes). Does not specify prerequisites or exclusion criteria.

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

analyze_query_indexesA

Recommend indexes for specific SQL queries. Provide up to 10 SELECT queries and get index recommendations.

ParametersJSON Schema
NameRequiredDescriptionDefault
queriesYesSQL SELECT queries to analyze (max 10)

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It states the tool 'recommends' indexes, suggesting it is read-only, but it does not confirm whether recommendations are only advisory or if any side effects occur. Missing details on required permissions, handling of invalid queries, or response structure.

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 two sentences with no wasted words. The first sentence states the core purpose, and the second provides a usage instruction. It is front-loaded and concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given one well-documented parameter and no output schema, the description is minimally complete. It explains what input to provide and what to expect (recommendations), but lacks information about output format, limitations, or when not to use. Adequate but not rich.

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 single parameter 'queries' is fully described in the input schema as 'SQL SELECT queries to analyze (max 10)'. The description adds 'Provide up to 10 SELECT queries' which repeats the schema, adding no new semantic information. Baseline 3 is appropriate given full schema coverage.

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 recommends indexes for specific SQL queries, using a specific verb ('Recommend') and resource ('indexes'). It distinguishes from siblings like 'analyze_workload_indexes' (workload-level) and 'explain_query' (execution plan), as it focuses on individual SELECT queries.

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 use when you have specific SELECT queries needing index recommendations, but it does not explicitly state when to use this tool versus alternatives like 'analyze_workload_indexes' or 'explain_query'. No exclusions or prerequisites are mentioned.

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

analyze_workload_indexesA

Analyze database workload and recommend indexes. Uses pg_stat_statements to find slow queries and suggests indexes to improve them.

ParametersJSON Schema
NameRequiredDescriptionDefault
topQueriesCountNoNumber of top queries to analyze (1-50)
includeHypotheticalNoTest recommendations with hypothetical indexes (requires hypopg)

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'recommend indexes' implying read-only, but does not explicitly confirm no mutation, required permissions, or potential side effects. The mechanism (pg_stat_statements) is disclosed, but safety profile is vague.

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?

Two sentences, no redundant information. First sentence states core purpose, second adds technical mechanism. Efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema or annotations, the description adequately explains purpose and mechanism but lacks details on return format, error handling (e.g., missing hypopg), and behavioral traits like read-only nature. Sibling tools like analyze_query_indexes create ambiguity that could be clarified.

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 coverage is 100% with clear descriptions for both parameters. The description adds value by explaining that includeHypothetical requires hypopg extension, which is not in the schema. This extra context helps correct usage.

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 uses specific verb 'Analyze' and 'recommend', clearly identifies the resource (database workload and indexes), and distinguishes from siblings like analyze_db_health and analyze_query_indexes by mentioning pg_stat_statements and slow queries.

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 index recommendations but does not explicitly state when to use this tool vs alternatives like analyze_query_indexes. No exclusions or prerequisites are mentioned, leaving the agent to infer context.

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

batch_executeA

Execute multiple SQL queries in parallel. Returns all results keyed by query name. Efficient for fetching multiple independent pieces of data in one call. Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
queriesYesArray of queries to execute (max 20)
stopOnErrorNoStop on first error (default: false, continues with all queries)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It mentions parallel execution and one-time overrides, but does not discuss rate limits, resource impact, or error behavior beyond the stopOnError parameter. Adequate but not comprehensive.

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?

The description is concise with three sentences, front-loading the key purpose. It avoids redundancy and is easy to parse. Could be slightly more structured but effective.

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?

Given no output schema, the description explains that results are keyed by query name. It covers the main use case and overrides. Missing details about result format or pagination, but sufficient for a batching tool.

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 parameters are well-documented structurally. The description adds context like 'keyed by query name' and 'max 20' which adds value, but does not significantly exceed what the schema already provides.

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 executes multiple SQL queries in parallel and returns results keyed by query name. It distinguishes from siblings like execute_sql by emphasizing parallelism and batching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says it is efficient for fetching multiple independent pieces of data in one call, and mentions optional server/database/schema overrides for one-time execution. This provides clear guidance on 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.

begin_transactionA

Start a new database transaction. Returns a transactionId to use with execute_sql, commit_transaction, or rollback_transaction. Transactions allow atomic execution of multiple statements.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNoOptional human-readable name for the transaction to help identify it later

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description adds minimal behavioral context beyond the basic function. It does not disclose potential side effects like lock acquisition or transaction timeout, which could affect agent decision-making.

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?

Two sentences that are front-loaded with the primary action and immediately useful. No unnecessary words.

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?

Given the tool's simplicity (one optional parameter, no output schema), the description covers the essentials: action, return value, and related tools. A mention of the scope or implications of a transaction would improve completeness.

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 coverage is 100% for the single optional parameter, and the description does not add further meaning beyond the schema. Baseline score of 3 is appropriate.

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 'Start a new database transaction' and specifies the return value and associated tools. It distinguishes itself from sibling transaction tools like commit_transaction and rollback_transaction.

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 indicates usage with execute_sql, commit_transaction, and rollback_transaction, and mentions atomic execution. However, it lacks explicit guidance on when not to use or alternatives beyond the transaction lifecycle.

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

column_profileA

Single-pass profile per column: null %, distinct count, top-K values with frequencies, min/max, and type-aware stats (avg/stddev for numeric, length distribution for text, range for temporal). Uses TABLESAMPLE BERNOULLI for tables larger than sample_threshold (default 1M rows) to keep latency bounded. Replaces a dozen separate exploratory queries an AI agent would otherwise run to understand a column's shape.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYes
schemaNopublic
columnsNoSpecific columns to profile (default: all up to 30).
sample_percentNo
sample_thresholdNo
top_kNoTop-K values per column (max 25).
serverNo
databaseNo
override_schemaNo

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses use of TABLESAMPLE BERNOULLI for large tables, single-pass computation, and latency bounding. It does not cover permissions, locking, or sampling accuracy trade-offs, but the core behavior is transparent.

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?

The description is a single paragraph of three sentences, concise and front-loaded with key functionality. It could be slightly more structured with bullet points, but it is efficient and free of fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and 9 parameters, the description omits crucial details like return format, default column limit (30), and full parameter roles. While it explains the algorithm, it is not complete enough for an agent to use it without guessing return structure.

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

Parameters2/5

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

Schema coverage is only 22%, and the description adds limited parameter explanation. It mentions sample_threshold and sample_percent implicitly via sampling algorithm, but parameters like server, database, override_schema are undocumented. The description does not sufficiently compensate for the schema gaps.

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 profiles columns in a table, listing specific statistics (null %, distinct count, top-K, etc.) and explains it replaces multiple exploratory queries, making the purpose unambiguous and distinct from tools like describe_table.

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 implies usage for understanding column shape efficiently, stating it replaces a dozen separate exploratory queries. However, it doesn't explicitly mention when not to use or compare to specific sibling tools, but the context is clear.

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

commit_transactionB

Commit an active transaction, making all changes permanent.

ParametersJSON Schema
NameRequiredDescriptionDefault
transactionIdYesThe transaction ID returned by begin_transaction

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the key behavior (committing makes changes permanent) but does not address failure cases (e.g., invalid transaction ID, already committed transaction) or side effects. This is adequate but minimal.

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?

A single, well-structured sentence that explains both the action and result concisely. No wasteful words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple commit operation with one parameter and no output schema, the description is minimally complete. It covers the primary purpose but misses edge cases or error conditions, which would improve completeness.

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 has 100% coverage, with the only parameter (transactionId) described as 'The transaction ID returned by begin_transaction'. The description adds no additional meaning beyond this, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Commit an active transaction') and the outcome ('making all changes permanent'). It pairs with siblings like begin_transaction and rollback_transaction, so the purpose is clear, though it does not explicitly differentiate from these siblings beyond the verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like rollback_transaction. There is no mention of prerequisites (e.g., requires an active transaction started by begin_transaction) or conditions for use.

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

describe_tableA

Single rich call describing a table: columns (type/nullable/default + null %/distinct ratio from pg_stats), primary key, foreign keys going OUT (this table → others) AND coming IN (others → this table), all indexes (with definitions), table size, row-count estimate, and sample rows. Replaces ~5 separate calls (get_object_details + LIMIT 5 + COUNT(*) + pg_stats).

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable name (unqualified — use schema for the schema).
schemaNopublic
sample_sizeNoNumber of sample rows to fetch (0 to skip).
profile_columnsNoColumns to profile (default: all up to 20).
serverNo
databaseNo
override_schemaNoOne-time schema override for the connection (separate from `schema` which is the table's schema).

TDQS

A4.6/5.0
Behavior4/5

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

No annotations provided, so the description carries full burden. It describes the rich read output and parameter behaviors (sample_size can skip, profile_columns default up to 20). It does not explicitly state it is read-only, but that is strongly implied by the listing nature. Slight room to mention non-destructiveness.

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?

Two sentences, front-loaded with the core proposition ('replaces ~5 separate calls'). Every piece of information earns its place; no fluff.

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?

Given 7 parameters and no output schema, the description covers the tool's purpose, output, and parameter behaviors well. It does not detail the return format, but the listing of returned fields provides adequate context for an agent. Minor gap: no mention of error handling or prerequisites.

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 coverage is 57%, and the description adds meaning to key parameters: table is unqualified, schema is separate from override_schema, sample_size and profile_columns have defaults explained. Server and database lack schema descriptions, but the description does not compensate; still, overall adds value beyond schema.

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?

Description clearly states it's a single call describing a table, enumerating all returned elements (columns, PKs, FKs, indexes, size, row count, sample rows). It also explicitly contrasts with alternatives, making the tool's unique value unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states that this tool replaces ~5 separate calls (get_object_details + LIMIT 5 + COUNT(*) + pg_stats), providing clear when-to-use guidance. No ambiguity about its purpose versus sibling tools.

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

detect_migration_stateA

Probe the database for migration tool tracker tables (Liquibase, Flyway, Alembic, Prisma, Knex, Sequelize, Django, Rails, Goose, TypeORM). Returns which tools are detected, the schema and table holding their state, the count of applied migrations, and the latest version. AI agents use this to immediately understand whether the DB is managed by a migration tool before suggesting changes.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemasNoSchemas to probe. Default: all non-system schemas.
serverNo
databaseNo
schemaNo

TDQS

A3.8/5.0
Behavior3/5

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

The description indicates a read-only probe ('probe', 'returns'), but without annotations, it does not explicitly state that the tool has no side effects, requires no special permissions, or has any performance impact. The description is adequate but not fully transparent.

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?

The description is concise, with two sentences conveying the core functionality and usage context. No redundant information is present, though it could be slightly more streamlined.

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 return values (detected tools, schema/table, count, latest version) reasonably well, compensating for the lack of an output schema. Given the tool's complexity and no output schema, the description provides enough context for an AI agent to understand what to expect.

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

Parameters2/5

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

Schema description coverage is only 25%, with only the 'schemas' parameter documented in the schema. The tool description adds value for 'schemas' (default: all non-system) but provides no additional meaning for 'server', 'database', and 'schema' parameters. With low coverage, the description should compensate more.

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 probes for migration tool tracker tables and returns specific details (tools detected, schema/table, count, latest version). It also explicitly explains the AI agent use case, distinguishing it from sibling tools that analyze database health or indexes.

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 implies usage before suggesting changes, providing clear context for when to use. However, it lacks explicit exclusions or alternatives, such as when not to use it or what to use instead if migration state is not needed.

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

dry_run_sql_fileA

Execute a SQL file in dry-run mode - actually runs ALL statements within a transaction, captures REAL results for each (row counts, errors with line numbers, constraint violations), then ROLLBACK so nothing persists. Perfect for testing migrations before deploying. Returns detailed error info including PostgreSQL error codes, constraint names, and hints to help quickly fix issues. Warns about non-rollbackable operations (sequences, VACUUM, etc.). Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .sql file to dry-run
stripPatternsNoPatterns to strip from SQL before execution (e.g., ['/'] for Liquibase)
stripAsRegexNoIf true, stripPatterns are treated as regex patterns
maxStatementsNoMaximum statements to include in results (default: 50, max: 200)
stopOnErrorNoStop on first error (default: false - continues to show ALL errors)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses transaction rollback, real result capture, and warnings about non-rollbackable operations. Does not mention behavior on connection loss or transaction abort, but covers key behavioral aspects.

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?

Description is well-structured with front-loaded action and behavior. Slightly long but each sentence adds value; no redundancy.

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?

No output schema, so description explains return values (row counts, errors with line numbers) and warns about non-rollbackable operations. Comprehensive for a dry-run testing 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 100%; description adds some context (e.g., example for stripPatterns, one-time execution for server/database/schema). Adds value beyond schema but not extensively.

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 it executes a SQL file in dry-run mode, runs statements within a transaction, captures real results, then rolls back. It distinguishes from siblings like execute_sql_file (which commits) and preview_sql_file (likely just shows statements).

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?

Explicitly says 'Perfect for testing migrations before deploying' and mentions optional server/database/schema overrides. Does not explicitly state when not to use it, but context implies it's for testing; alternatives like execute_sql_file are implied but not named.

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

execute_sqlA

Execute SQL queries. Supports SELECT, INSERT, UPDATE, DELETE (if not in readonly mode). Use $1, $2 placeholders with params array to prevent SQL injection. Use allowMultipleStatements to run multiple statements separated by semicolons. Use transactionId to run within a transaction. Optionally use server/database/schema params for one-time execution on a different server without changing the main connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL statement(s). Use $1, $2, etc. for parameterized queries.
paramsNoParameters for $1, $2, etc. placeholders (e.g., [123, 'value']). Not supported with allowMultipleStatements.
maxRowsNoMax rows to return (default: 1000, max: 100000)
offsetNoSkip rows for pagination
allowLargeScriptNoBypass 100KB SQL limit for deployment scripts
includeSchemaHintNoInclude schema info (columns, PKs, FKs) for tables in the query.
allowMultipleStatementsNoAllow multiple SQL statements separated by semicolons. Returns results for each statement.
transactionIdNoExecute within an active transaction. Get this from begin_transaction.
maxEstimatedRowsNoSP-7 query budget: refuse to run if the planner estimates more than this many rows. Pre-EXPLAIN check on read-only queries only. Useful as a backstop for AI-generated queries.
maxEstimatedCostNoSP-7 query budget: refuse to run if the planner estimates total cost above this. Read-only queries only.
serverNoOne-time server override. Execute on this server without changing main connection. Cannot be used with transactionId.
databaseNoOne-time database override. Uses this database for execution without changing main connection.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses support for different SQL types, parameterization, multiple statements, transactions, and query budget controls. However, it does not describe return format (e.g., array of objects for SELECT, affected rows for DML), error behavior, or the 100KB limit for large scripts, which are important for agent decision-making.

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?

The description is a single paragraph that is front-loaded with the core purpose and then expands on key details. It is concise but packed with information. Could benefit from bullet points or sectioning for clarity, but remains efficient.

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?

Given 13 parameters and no output schema, the description covers most behavioral aspects: parameterization, multiple statements, transactions, overrides, query budgets. It lacks explanation of return types or error handling, and could mention restrictions like server/database not usable with transactionId. Fairly complete for a complex tool.

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

Parameters5/5

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

Schema description coverage is 100%, and the description adds significant meaning beyond the schema: explains $1, $2 placeholders, incompatibility of params with allowMultipleStatements, default/max for maxRows, bypass for allowLargeScript, schema info via includeSchemaHint, SP-7 query budget for maxEstimatedRows/Cost, and one-time overrides for server/database/schema. This enriches the agent's understanding.

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?

Description clearly states it executes SQL queries with support for SELECT, INSERT, UPDATE, DELETE, parameterized queries, multiple statements, transactions, and one-time overrides. It differentiates from sibling tools like analyze, explain, and file-based executors by focusing on raw SQL execution.

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?

Provides guidance on using $1, $2 placeholders with params array to prevent SQL injection, allowMultipleStatements for multiple semicolon-separated statements, transactionId for transactional execution, and one-time server/database/schema overrides. Does not explicitly exclude alternatives but implicitly distinguishes from sibling tools.

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

execute_sql_fileA

Execute a .sql file from the filesystem. Useful for running migration scripts, schema changes, or data imports. Supports transaction mode for atomic execution. Max file size: 50MB. Use validateOnly=true to preview without executing. Use stripPatterns to remove delimiters like '/' (Liquibase) or 'GO' (SQL Server). Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .sql file to execute
useTransactionNoWrap execution in a transaction (default: true). If any statement fails, all changes are rolled back.
stopOnErrorNoStop execution on first error (default: true). If false, continues with remaining statements.
stripPatternsNoPatterns to strip from SQL before execution. E.g., ['/'] for Liquibase, ['GO'] for SQL Server. By default, patterns are matched as literal strings on their own line.
stripAsRegexNoIf true, stripPatterns are treated as regex patterns (default: false). Use for complex patterns like '^\\s*/\\s*$'.
validateOnlyNoIf true, parse and preview the file without executing (default: false). Returns statement count and types.
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses file size limit, transaction mode, validateOnly, stripPatterns, and server/database/schema overrides. Missing details on permissions or exact return format.

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?

Concise multi-sentence description with front-loaded main action and succint additional details. No wasted words.

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?

Given no output schema, description covers key aspects (size limit, transaction, preview, stripping, overrides). Lacks return value explanation but sufficient for most agents.

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 coverage 100%, but description adds value with examples for stripPatterns ('/','GO') and clarifies validateOnly and server/database/schema usage. Baseline 3, bonus for extra context.

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?

Clearly states 'Execute a .sql file from the filesystem' with specific use cases (migration scripts, schema changes, data imports). Distinguishes from siblings like dry_run_sql_file and preview_sql_file.

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?

Describes when to use (migration scripts, etc.) and mentions one-time overrides. Lacks explicit contrast with execute_sql for inline SQL, but still clear.

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

explain_queryA

Show PostgreSQL's execution plan for a query. Use this to understand query performance and identify missing indexes. analyze=true runs the query to get actual timings (SELECT only). Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to explain
analyzeNoExecute query for real timing (SELECT only, blocked for writes)
buffersNoInclude buffer/cache statistics
formatNoOutput formatjson
hypotheticalIndexesNoTest hypothetical indexes (requires hypopg extension)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.5/5.0
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It discloses behavioral traits: analyze executes the query for real timings (SELECT only, blocked for writes), hypothetical indexes require the hypopg extension, and server/database/schema are one-time overrides. It does not explicitly state that the tool is read-only, but the description implies safety.

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: three sentences covering purpose, usage, and key parameters. Every sentence adds value without redundancy. It is well-structured and front-loaded with the main purpose.

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?

Given 8 parameters, no output schema, and many sibling tools, the description covers the essential aspects: purpose, key parameters, and behavioral notes. It could mention that the output is the execution plan itself, but that is implied. Overall, it is sufficiently complete for an agent to use the tool correctly.

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

Parameters5/5

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

Schema coverage is 100% with descriptions for all parameters. The description adds significant meaning beyond the schema: it explains that analyze gives actual timings (SELECT only), buffers includes cache statistics, format outputs in various formats, hypothetical indexes need hypopg, and server/database/schema are for one-time execution. This enhances the agent's understanding.

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's purpose: 'Show PostgreSQL's execution plan for a query.' It specifies the action (show execution plan) and the resource (PostgreSQL query), and distinguishes its use case from sibling tools by mentioning performance analysis and missing indexes.

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 provides usage context: 'Use this to understand query performance and identify missing indexes.' It also gives specific guidance on the analyze parameter: 'analyze=true runs the query to get actual timings (SELECT only).' However, it does not explicitly contrast with sibling tools like analyze_query_indexes, which slightly reduces clarity.

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

export_to_sql_fileA

Export schema (DDL) and/or data from the connected database to a .sql file. Supports four content kinds via the 'what' parameter: 'objects' (DDL of a list of objects), 'data' (INSERT statements for tables), 'schema_dump' (full schema, optionally with data), 'query_result' (SELECT result emitted as INSERTs into a target table). Mode is 'append' (default, appends to existing file with separator banner) or 'overwrite'. The header banner records timestamp and source server alias (host/port hidden). Use this before transfer_objects or for migration script generation.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .sql file. Must end with .sql.
modeNoFile write mode. Append (default) preserves existing content with a separator banner; overwrite replaces the file.append
whatYes
include_create_if_not_existsNo
confirm_overwriteNoWhen mode='overwrite' and file was modified <60s ago, set true to confirm. Foot-gun guard.
serverNoOne-time server override.
databaseNoOne-time database override.
schemaNoOne-time schema override (sets default schema for refs).

TDQS

A4.4/5.0
Behavior4/5

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

Details file modes (append/overwrite with banner), header banner recording timestamp and server alias (host/port hidden), and foot-gun guard for confirm_overwrite. No annotations, so description carries burden; covers key behavioral traits.

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 purpose, then organized by content kinds, modes, and usage note. Slightly lengthy but appropriate for complexity; no wasted sentences.

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?

Given 8 parameters, no output schema, and no annotations, the description covers all content kinds, modes, header, and usage guidance. It is comprehensive and leaves no major gaps.

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 coverage is 75%, but the description adds value by explaining the four 'what' kinds, mode behavior, and header banner. It clarifies complex union schema and enhances understanding.

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 it exports schema and/or data to a .sql file, then details four content kinds. It differentiates from siblings by mentioning use before transfer_objects.

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?

Explicitly says 'Use this before transfer_objects or for migration script generation.' Provides context on modes and content kinds, but no exclusions or alternatives beyond that.

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

find_blocking_queriesB

Show currently-blocking sessions in a friendly tree (blocker → blocked) using pg_stat_activity ⨝ pg_blocking_pids(). Replaces the gnarly join an AI agent struggles to write. Returns each session's pid, user, database, application name, state, current query, time in state, and wait_event. Use to diagnose slowdowns and pick a candidate for kill_query.

ParametersJSON Schema
NameRequiredDescriptionDefault
include_idleNo
limitNo
serverNo
databaseNo
schemaNo

TDQS

B3.4/5.0
Behavior3/5

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

Describes the output fields (pid, user, database, etc.) and the join operation, but does not explicitly state that the tool is read-only or non-destructive. With no annotations, more explicit behavioral disclosure would be beneficial.

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?

The description is concise (2-3 sentences), front-loaded with the main purpose, and avoids redundancy. Minor improvement could be adding structure for parameter explanations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema and 0% parameter coverage, the description explains outputs well but completely ignores input parameters. This leaves significant gaps for the agent to use the tool correctly.

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

Parameters1/5

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

Schema description coverage is 0%, and the description provides no explanation of the 5 parameters (include_idle, limit, server, database, schema). The agent receives no guidance on how to use these inputs.

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 it shows blocking sessions in a tree format using pg_stat_activity and pg_blocking_pids, with a specific purpose of diagnosing slowdowns. It distinguishes itself from siblings like kill_query and lock_check.

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?

Explicitly says 'Use to diagnose slowdowns and pick a candidate for kill_query,' providing clear context and a downstream action. However, it does not specify when not to use or compare to alternatives like lock_check.

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

find_dependentsA

Find what depends on a database object before dropping it. Recursively walks pg_depend, classifies dependents (views, foreign keys, functions, materialized views, indexes, rules) and reports each with its depth from the target. Use this BEFORE running DROP CASCADE to understand the blast radius. Returns the dependent objects flattened with depth (1 = directly depends, 2 = depends on a depth-1 dependent, etc).

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesObject name.
kindNotable
schemaNopublic
max_depthNoRecursion limit (1-10).
serverNo
databaseNo
override_schemaNo

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses recursive walking of pg_depend, classification of dependents, and depth reporting. Missing details like error handling or performance but covers core behavior well.

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?

Concise four-sentence description with front-loaded purpose. No redundant text, though could be slightly more compact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so description should detail return format. It mentions depth but not other fields. For a complex tool with 7 params, it covers purpose well but leaves parameter and output details incomplete.

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

Parameters2/5

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

Schema coverage is only 29%, yet the description does not explain parameters like server, database, or override_schema. It adds no value beyond the schema for most parameters, leaving gaps.

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 action (find), resource (dependents of a database object), and context (before dropping). It differentiates from sibling tools by specifying recursive dependency analysis via pg_depend.

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?

Explicitly states 'Use this BEFORE running DROP CASCADE to understand the blast radius,' providing clear when-to-use guidance. However, no explicit alternatives are given for when not to use.

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

generate_seed_dataA

Generate schema-aware fake seed data for a table. Respects NOT NULL, UNIQUE/PK (with retry-with-collision-suffix), enum types (cycles through labels), defaults (uses DEFAULT for unknown types), text length limits, and FK columns (skipped or filled — caller's choice). Generates type-appropriate values for numeric, text, boolean, uuid, date/timestamp, bytea, JSON, inet, cidr, macaddr. Per-column overrides via column_values. Apply directly (default) or return SQL only via apply: false.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYes
schemaNopublic
countYes
column_valuesNoPer-column SQL value override (e.g. { country: "'US'", priority: '1' }). Quoted as PG literals.
skip_fksNo
applyNoApply to DB (default true) or return SQL only (false).
serverNo
databaseNo
override_schemaNo

TDQS

A4.1/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses many behaviors: respecting constraints, handling types, per-column overrides, and execution mode. Lacks details on permissions or error handling, but covers the main traits.

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?

Single well-structured sentence with bullet-like enumeration. Front-loaded with purpose. No redundancy, though breaking into clearer sections could improve readability.

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?

Given 9 parameters and no output schema, description covers inputs, core behaviors, and output mode. Missing details on return value when apply is false and error scenarios, but overall complete for most use cases.

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 coverage is low (22%), and description adds meaning for key parameters (table, count, column_values, skip_fks, apply) but does not explain server, database, override_schema, or schema beyond their names. Partial compensation.

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?

Description clearly states it generates schema-aware fake seed data for a table, listing many features that distinguish it from sibling tools (analyze, execute, etc.). The verb 'generate' and resource 'seed data' are specific.

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?

Implies when to use (need seed data) and mentions apply vs SQL-only via `apply: false`. Does not explicitly state when not to use or compare to alternatives, but the shared context makes it clear.

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

get_current_connectionA

Get current connection status. Returns server name, database, schema, and access mode (readonly/full). Call this to verify your connection before running queries.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description fully carries the burden. It is transparent about the output (returned fields and access mode) and implies no side effects. Missing permission requirements but acceptable for a read-only status check.

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?

Two sentences: first clearly states purpose and output, second provides usage guidance. No extraneous words; every sentence adds value.

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?

Despite no output schema, the description lists all returned fields. The tool is simple enough that no additional context (e.g., error handling, permissions) is critical. Complete for its function.

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?

The tool has no parameters and schema coverage is 100%, so the description needs to add nothing. Baseline of 4 is appropriate.

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 'Get current connection status' and explicitly lists the returned fields (server name, database, schema, access mode). This uniquely identifies the tool among siblings like list_databases and list_servers.

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 advises 'Call this to verify your connection before running queries,' providing a clear use case. While it doesn't mention when not to use or alternatives, the simplicity of the tool makes this sufficient.

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

get_object_detailsA

Get detailed info about a table/view/sequence: columns, data types, constraints, indexes, size, row count. Use this to understand table structure before writing queries. Optionally use server/database/targetSchema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema name containing the object
objectNameYesName of the table, view, or sequence
objectTypeNoObject type (auto-detected if not specified)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
targetSchemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.2/5.0
Behavior3/5

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

No annotations were provided, so the description carries full burden. It describes the operation as retrieving info but does not explicitly state it is read-only, non-destructive, or free of side effects. It lacks details on authorization or rate limits.

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?

Two concise sentences: first states purpose and outputs, second adds optional usage. No redundancy, efficiently front-loaded.

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?

Given no output schema, the description lists key return categories (columns, data types, constraints, indexes, size, row count) but does not specify the exact structure. This is largely sufficient for an agent to understand the tool's value.

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 100%, so baseline is 3. The description adds value by explaining the one-time override parameters ('Optionally use server/database/targetSchema params for one-time execution on a different server'), reinforcing the schema descriptions.

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 action ('Get detailed info') and the resources ('table/view/sequence'), listing specific outputs (columns, data types, constraints, etc.). It distinguishes from siblings like 'describe_table' by implying a more comprehensive analysis.

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 explicitly advises 'Use this to understand table structure before writing queries,' providing clear context for when to use. It also mentions optional overrides for one-time execution but does not explicitly exclude alternatives like 'describe_table'.

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

get_top_queriesA

Find slowest queries from pg_stat_statements. Requires pg_stat_statements extension enabled. Use this to identify performance bottlenecks.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of queries to return (1-100)
orderByNoSort by total time, average time, or call counttotal_time
minCallsNoMinimum call count to include

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses a critical prerequisite ('Requires pg_stat_statements extension enabled'), which aids safe usage. However, it does not explicitly state whether the tool is read-only (though implied) or describe any side effects or output structure. This leaves some behavioral ambiguity.

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 extremely concise (two sentences) and front-loaded: first sentence states the action, second adds a requirement and use case. Every word earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 3 parameters and no annotations or output schema. The description covers the prerequisite and high-level purpose but does not describe the return values (e.g., columns returned, pagination). For a diagnostic tool, this gap could affect an agent's ability to interpret results correctly.

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 coverage is 100%, so the input schema adequately documents each parameter (limit, orderBy, minCalls). The description does not add additional parameter-level meaning beyond the schema (e.g., it doesn't explain what 'total_time' means). Baseline 3 is appropriate since the schema is self-sufficient.

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's function: 'Find slowest queries from pg_stat_statements.' It uses a specific verb ('find') and resource ('slowest queries'), and the context 'identify performance bottlenecks' distinguishes it from sibling tools like analyze_query_indexes or find_blocking_queries.

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 gives a clear usage context: 'Use this to identify performance bottlenecks.' However, it does not explicitly state when not to use this tool or suggest alternatives from the sibling list. The instruction is helpful but lacks exclusion guidance, which would improve decision-making.

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

get_transaction_infoA

Get information about an active transaction, including its name, server, database, and when it started.

ParametersJSON Schema
NameRequiredDescriptionDefault
transactionIdYesThe transaction ID returned by begin_transaction

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It correctly indicates the operation is a read ('Get information'), but does not disclose potential failure cases (e.g., invalid or completed transaction ID) or any safe behavioral traits beyond the basic purpose.

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 a single, well-structured sentence that front-loads the action and resource, followed by specifics. Every word earns its place with no redundancy or fluff.

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?

For a simple single-parameter tool with no output schema, the description adequately outlines the returned information. It is missing error-handling or edge-case context, but overall completeness is high given the low complexity.

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 schema already describes the 'transactionId' parameter as 'The transaction ID returned by begin_transaction' (100% coverage). The tool description adds no additional meaning or context beyond that, so it meets the baseline without enhancement.

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's purpose with a specific verb ('Get information') and resource ('active transaction'), and lists the included fields (name, server, database, started). It effectively distinguishes from sibling tools like list_transactions (list) and transactional action tools.

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 when a transaction ID is available, but does not explicitly guide when to use this tool over alternatives like 'list_transactions' or other transaction-related tools. No exclusions or when-not-to-use guidance is provided.

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

kill_queryA

Cancel or terminate a backend session by PID. mode='cancel' (soft, pg_cancel_backend) interrupts the current statement; mode='terminate' (hard, pg_terminate_backend) kills the entire backend. Both require confirm:true. Refused if the target server's effective access mode is readonly. Returns a snapshot of the target session before signaling.

ParametersJSON Schema
NameRequiredDescriptionDefault
pidYesBackend PID to signal.
modeYesSoft cancel (statement only) or hard terminate (backend).
confirmYesRequired confirmation. Foot-gun guard.
serverNo
databaseNo
schemaNo

TDQS

A4.4/5.0
Behavior5/5

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

No annotations provided, so description fully covers behavior: cancel interrupts statement, terminate kills backend, requires confirm, refused in readonly mode, returns snapshot before signaling. This is comprehensive for a kill operation.

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?

Three sentences, front-loaded with purpose, then mode details, then conditions and return. No wasted words.

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?

Without annotations or output schema, description covers core functionality and return value. Missing details on error handling or invalid PID, but adequate for a kill tool with clear required params.

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?

Description adds meaning for pid, mode, and confirm beyond schema (e.g., soft/hard, foot-gun guard). However, it does not explain the optional server, database, and schema parameters, which are only in schema without descriptions. Given 50% schema coverage, description only partially compensates.

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?

Description clearly states the tool cancels or terminates a backend session by PID, distinguishing between soft cancel and hard terminate. It uses specific verb+resource and is distinct from siblings like 'find_blocking_queries' or 'lock_check'.

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?

Description explains when to use cancel vs terminate, and mentions the confirm requirement and readonly restriction. However, it does not explicitly state when not to use this tool or suggest alternatives.

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

list_databasesA

List databases in a specific PostgreSQL server. REQUIRES serverName parameter - use list_servers first to get valid server names. Do NOT guess server names.

ParametersJSON Schema
NameRequiredDescriptionDefault
serverNameYesREQUIRED: Server name from list_servers. Do NOT use database names here.
filterNoFilter databases by name (case-insensitive partial match)
includeSystemDbsNoInclude system databases (template0, template1)
maxResultsNoMaximum databases to return (default: 50, max: 200)

TDQS

A4.2/5.0
Behavior3/5

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

No annotations provided, so description must carry behavioral info. It discloses the required parameter and workflow but omits details like read-only nature, default exclusions of system databases, or maxResults limit, which are only in the schema.

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?

Two concise sentences, front-loaded with purpose, no redundancy. Every word earns its place.

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?

Appropriately complete for a simple list tool with well-described parameters in schema. Could mention default exclusions or output format, but not essential given schema coverage.

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 covers 100% of parameters with descriptions, including the serverName requirement and exclusion of database names. The description repeats this without adding new semantic value beyond the schema.

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 verb 'list' and resource 'databases', with specific context (PostgreSQL server). It distinguishes from sibling tools like list_servers by emphasizing the serverName requirement and directing users to list_servers first.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to obtain serverName from list_servers and warns against guessing, providing clear when-to-use and when-not-to-use guidance relative to siblings.

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

list_objectsA

List tables, views, materialized views, sequences, or extensions in a schema. Requires active connection. Optionally use server/database/targetSchema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema name to list objects from (e.g., 'public')
objectTypeNoType of objects to listall
filterNoFilter objects by name (case-insensitive partial match)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
targetSchemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4/5.0
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses need for active connection and one-time nature of override params, but lacks detail on error cases or output behavior.

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?

Two sentences, no redundancy. First sentence states purpose, second adds usage guidance. Efficient and well-structured.

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?

Covers main purpose, prerequisites, and optional overrides. Missing output format or return value description, which would be helpful given no output schema.

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 coverage is 100%, so baseline is 3. Description mostly restates parameter purposes (e.g., 'one-time execution'), adding minimal new meaning beyond schema descriptions.

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?

Description clearly states it lists specific object types (tables, views, etc.) in a schema, with a clear verb and resource. It distinguishes from sibling list tools by focusing on schema-level objects.

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?

Mentions prerequisite 'Requires active connection' and explains when to use optional overrides. Does not explicitly list alternatives but context makes differentiation clear.

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

list_schemasA

List all schemas in the current database. Requires active connection (use switch_server_db first). Optionally use server/database/schema params for one-time execution on a different server without changing the main connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
includeSystemSchemasNoInclude system schemas (pg_catalog, information_schema, etc.)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution without changing main connection.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool lists schemas, requires a connection, and allows temporary overrides. It does not mention security or performance, but for a read-only listing these are less critical. The inclusion of the includeSystemSchemas parameter downstream adds transparency.

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?

Two sentences with front-loaded purpose and key usage conditions. No extraneous information. Every sentence contributes to understanding.

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?

Given the schema covers params and there is no output schema, the description is fairly complete. It could mention the default filtering of system schemas or the return format, but the presence of the includeSystemSchemas param and the listing nature makes it adequate.

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?

The input schema has 100% description coverage. The description adds value by explaining that server, database, and schema params are for one-time overrides without changing the main connection, which is not evident from schema descriptions alone.

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 verb 'List' and the resource 'schemas in the current database'. It differentiates from sibling tools like list_databases and list_objects by specifying the target is schemas, and mentions the one-time override params that are unique to this tool.

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 explicitly states the prerequisite 'Requires active connection (use switch_server_db first)' and explains when to use the optional override params for one-time execution. It does not explicitly list alternatives or when not to use, but the context is clear and actionable.

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

list_serversA

List all configured PostgreSQL servers. Call this FIRST to discover available server names before using list_databases or switch_server_db. Returns server names and connection status.

ParametersJSON Schema
NameRequiredDescriptionDefault
filterNoFilter servers by name (case-insensitive partial match)

TDQS

A4.4/5.0
Behavior4/5

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

While no annotations are provided, the description reveals that the tool returns server names and connection status, implying it checks connectivity. It does not explicitly state it is read-only, but 'List' implies no destructive side effects.

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?

Three concise sentences: purpose, usage guidance, output. No extraneous words, front-loaded with the most important information.

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?

Given no output schema, the description mentions the return values (server names and connection status). It does not cover potential edge cases like empty lists, but it is adequate for this simple tool.

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 description adds no information about the 'filter' parameter beyond what is already in the input schema (which has a comprehensive description). Schema coverage is 100%, so baseline 3 is appropriate.

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's purpose: 'List all configured PostgreSQL servers.' It distinguishes from sibling tools like list_databases and switch_server_db by instructing to call this first to discover server names.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance is given: 'Call this FIRST to discover available server names before using list_databases or switch_server_db.' This tells the agent when and in what order to use the tool.

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

list_transactionsA

List all active transactions. Returns transaction details including name, server, database, and start time.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior2/5

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

No annotations provided, so description bears full burden. It only states the basic operation and returned fields, without disclosing performance impact, permission requirements, or potential side effects.

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?

Single sentence that is front-loaded with the action and efficiently conveys the purpose and output. No extraneous words.

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?

For a simple list tool with no parameters and no output schema, the description is adequate. It could mention potential ordering or filtering, but not essential. Missing annotations reduce completeness slightly.

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?

No parameters exist, so schema coverage is 100%. Description adds no parameter info, but none is needed. Baseline 4 for zero-parameter tools.

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 verb 'list' and the resource 'active transactions', and specifies the returned details (name, server, database, start time). It distinguishes from siblings like get_transaction_info, which likely targets a specific transaction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives like get_transaction_info. No explicit context on appropriate scenarios or prerequisites.

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

lock_checkA

Static analysis of a SQL statement to determine the PostgreSQL lock level it will require, whether it forces a full table rewrite, and an estimated duration based on target table size. Returns warnings for ACCESS EXCLUSIVE locks on busy production tables and concrete recommendations (e.g., use CREATE INDEX CONCURRENTLY, NOT VALID + VALIDATE CONSTRAINT, etc). Use BEFORE running DDL on production. Knows lock semantics for ALTER TABLE variants, CREATE/DROP INDEX (concurrent vs not), VACUUM, CLUSTER, REFRESH MATERIALIZED VIEW, and more.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL DDL statement to analyze.
estimate_durationNoLook up target table size to estimate duration.
serverNo
databaseNo
schemaNo

TDQS

A3.7/5.0
Behavior3/5

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

No annotations exist, so description carries full burden. It describes outputs (warnings, recommendations) and scope of knowledge, but does not explicitly state it is read-only or handle edge cases. Adequate but not exhaustive.

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?

The description is a single paragraph, front-loads the key action, and contains no fluff. Could be slightly more structured but is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex lock analysis tool with no output schema and low parameter coverage, the description covers the main purpose and outputs but lacks specifics on return format, permissions, and limitations. Adequate for basic understanding.

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

Parameters2/5

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

Schema description coverage is low (40%). The description does not explain the server, database, or schema parameters, failing to compensate. Only sql and estimate_duration are described in schema, and description adds no further detail.

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 performs static analysis of SQL statements to determine PostgreSQL lock level, table rewrite, duration, and provides warnings/recommendations. It differentiates from sibling tools which are about database health, query indexes, etc.

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?

Explicitly advises 'Use BEFORE running DDL on production' and lists known SQL variants. While no explicit exclusions or alternatives are given, the usage context is clear.

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

mutation_dry_runA

Execute INSERT/UPDATE/DELETE in dry-run mode - actually runs the SQL within a transaction, captures REAL results (exact row counts, actual errors, before/after data), then ROLLBACK so nothing persists. More accurate than mutation_preview. Use this to verify mutations will work correctly before committing. Returns detailed PostgreSQL error info (code, constraint, hint) on failure. Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe INSERT, UPDATE, or DELETE statement to dry-run
sampleSizeNoNumber of sample rows to return (default: 10, max: 20)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.6/5.0
Behavior5/5

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

Since no annotations are provided, the description fully bears the disclosure burden. It thoroughly explains the transactional behavior, rollback, result details, error info, and optional overrides, leaving no ambiguity.

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 compact yet comprehensive, with no superfluous words. It front-loads the core function and efficiently conveys all necessary details.

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?

Given the complexity (5 parameters, no output schema), the description covers behavior, error information, and optional overrides adequately. It hints at the output format (row counts, errors, before/after data) but lacks a structured return description, though acceptable.

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?

With 100% schema coverage, baseline is 3. The description adds value by explaining the one-time execution nature of server/database/schema params and specifying the default and max for sampleSize, going beyond the schema.

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?

Description clearly states the tool executes INSERT/UPDATE/DELETE in dry-run mode, runs SQL in a transaction, captures real results, and rolls back. It distinguishes itself from mutation_preview, making the purpose unambiguous.

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?

Explicitly advises to use this tool to verify mutations before committing and notes it is more accurate than mutation_preview. However, it does not mention when not to use it or provide alternatives.

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

mutation_previewA

Preview the effect of INSERT/UPDATE/DELETE without executing. Shows estimated rows affected and sample of rows that would be modified. Use this before running destructive queries to verify the impact. Optionally use server/database/schema params for one-time execution on a different server.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe INSERT, UPDATE, or DELETE statement to preview
sampleSizeNoNumber of sample rows to show (default: 5, max: 20)
serverNoOne-time server override. Execute on this server without changing main connection.
databaseNoOne-time database override. Uses this database for execution.
schemaNoOne-time schema override. Sets search_path for this execution only.

TDQS

A4.2/5.0
Behavior4/5

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

No annotations present, but the description clearly states the tool is non-executing, shows estimates and samples, and mentions parameter limits (sampleSize max 20). Does not detail error handling but adequate for a preview tool.

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?

Three concise sentences that front-load purpose, then provide usage guidance and parameter hints. No fluff or repetition.

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?

All five parameters are covered by schema and description. Output behavior (estimated rows and samples) is described. Lacks description of error cases, but tool complexity is low and no output schema is expected.

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 baseline 3. The description adds minor reinforcement for optional overrides, but no significant extra meaning beyond the schema.

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?

Clearly states 'preview the effect of INSERT/UPDATE/DELETE without executing' with specific verb and resource, and distinguishes from siblings like execute_sql which actually run queries.

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?

Explicitly advises using this 'before running destructive queries to verify the impact', and describes optional server/database/schema overrides. Lacks explicit 'when not to use' but context implies distinction from actual execution.

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

preview_sql_fileA

Preview a SQL file without executing it. Shows statement count, types breakdown, and warnings for potentially dangerous operations (DROP, TRUNCATE, DELETE/UPDATE without WHERE). Similar to mutation_preview but for SQL files. Use this before execute_sql_file to understand what a migration will do.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .sql file to preview
stripPatternsNoPatterns to strip from SQL before parsing. E.g., ['/'] for Liquibase, ['GO'] for SQL Server.
stripAsRegexNoIf true, stripPatterns are treated as regex patterns (default: false).
maxStatementsNoMaximum number of statements to show in preview (default: 20, max: 100).

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden. It clearly states it does NOT execute the SQL, and describes the output (statement count, types, warnings). It doesn't mention file access or error handling, but the core behavior is transparent.

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?

Three concise sentences: what it does, comparison, and usage recommendation. No wasted words, information front-loaded.

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?

Given no output schema and no annotations, the description gives a solid overview. It explains what the tool does, what output to expect, and when to use it. Could mention return format or error scenarios, but sufficient for typical use.

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 coverage is 100%, so baseline is 3. The description does not add much beyond the schema; it briefly mentions 'warnings for dangerous operations' but that's more about output than parameters. The schema descriptions are clear enough.

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 'Preview a SQL file without executing it' and lists what it shows (statement count, types breakdown, warnings). It also distinguishes from sibling mutation_preview by specifying 'for SQL files'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use this before execute_sql_file to understand what a migration will do.' Also provides context by comparing to mutation_preview, helping the agent decide when to use this tool instead of others.

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

rollback_transactionA

Rollback an active transaction, undoing all changes made within it.

ParametersJSON Schema
NameRequiredDescriptionDefault
transactionIdYesThe transaction ID returned by begin_transaction

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description bears full burden. It discloses the core behavioral trait of undoing all changes, which is sufficient for a simple rollback. Could mention that the transaction is closed afterward, but overall transparent.

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 a single, front-loaded sentence that concisely conveys the purpose and effect. Every word is earned; no fluff.

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?

Given low complexity (one simple parameter, no output schema, no nested objects), the description adequately covers what the tool does and the parameter meaning. Sibling tools provide context for differentiation.

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% for the sole parameter 'transactionId', with a clear schema description. The tool description adds no further meaning, meeting the baseline of 3.

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 verb 'rollback', the resource 'active transaction', and the effect 'undoing all changes'. It distinguishes from sibling tools like 'commit_transaction' and 'begin_transaction'.

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 undoing changes within a transaction, but provides no explicit guidance on when to use this versus alternatives like 'commit_transaction' or 'rollback_transaction' itself. No when-not-to-use or context is given.

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

safe_alter_tableA

Convert a high-level intent ('add NOT NULL column with default', 'add NOT NULL', 'add foreign key', 'add CHECK', 'create index', 'drop index') into a multi-step zero-downtime DDL recipe. Each step has its own SQL, expected lock level, and notes. Pipe the resulting scriptSql through dry_run_sql_file for verification, then through executeSqlFile(useTransaction=false) for the production rollout (CONCURRENTLY operations cannot run inside a transaction).

ParametersJSON Schema
NameRequiredDescriptionDefault
intentYes

TDQS

A4.4/5.0
Behavior4/5

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

Since no annotations are provided, the description carries full burden. It discloses that the output contains scriptSql, lock levels, and notes, and mentions transaction constraints. It lacks details on error handling or validation, but covers key behaviors.

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 two sentences plus a brief instruction, front-loaded with the core purpose. Every sentence adds value 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?

Given high complexity and no output schema, the description adequately explains the recipe output (SQL, lock level, notes) and usage workflow. It could be more detailed on return structure, but is sufficient for most use cases.

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 coverage is 0%, so description compensates by explaining the 'intent' parameter's kinds (e.g., 'add NOT NULL column with default'). This adds meaning beyond the bare schema structure, though it does not detail each sub-field.

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 converts a high-level intent into a multi-step zero-downtime DDL recipe. It lists specific intent types (e.g., 'add NOT NULL column with default') and explains the output format (SQL, lock level, notes), distinguishing it from siblings like execute_sql.

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 provides explicit workflow: use the recipe output with dry_run_sql_file then executeSqlFile. It warns about CONCURRENTLY operations outside transactions. However, it does not explicitly state when to use this versus direct ALTER TABLE or other mutation tools.

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

schema_diffA

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sourceYes
targetYes

TDQS

A4/5.0
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.

switch_server_dbA

Connect to a PostgreSQL server and database. MUST be called before executing queries. Use list_servers to find server names, list_databases to find database names.

ParametersJSON Schema
NameRequiredDescriptionDefault
serverYesServer name from list_servers (NOT the host)
databaseNoDatabase name from list_databases (defaults to server's default or 'postgres')
schemaNoSchema name (defaults to 'public')

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are present, so the description must convey behavioral traits. It mentions connection and prerequisite calls but lacks details on side effects (e.g., connection persistence, error handling, or state changes).

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?

Two concise sentences, front-loaded with the primary action, and no extraneous information. Every word earns its place.

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?

For a simple connection tool with three parameters and no output schema, the description adequately covers purpose, prerequisites, and defaults. It lacks details on return values or connection lifecycle, but these are 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?

Schema description coverage is 100% and already includes explanatory descriptions. The main description adds minor reinforcement (e.g., using list_servers) but does not significantly enhance understanding beyond the schema.

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's purpose: 'Connect to a PostgreSQL server and database.' It distinguishes from siblings as a prerequisite for queries and references specific discovery tools (list_servers, list_databases).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states 'MUST be called before executing queries' and directs the user to list_servers and list_databases for parameter values, providing clear when-to-use guidance.

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

transfer_objectsA

Transfer schema (DDL) and/or data from one configured server/database to another (same server, different DB, or fully remote). Builds on the introspection module for DDL extraction with topological ordering. Modes: include='ddl'|'data'|'both'. Behavior on existing target objects: if_exists='skip'|'replace'|'error'. dry_run=true emits the would-be SQL to output_file or returns inline (no target writes). Both endpoints must be configured servers (PG_NAME_*); ad-hoc connection strings are not accepted (security). Refuses if target's effective access mode is readonly. FK constraints between tables are emitted as ALTER TABLE statements appended after tables to handle inter-table dependency cycles.

ParametersJSON Schema
NameRequiredDescriptionDefault
fromYesSource endpoint.
toYesTarget endpoint.
objectsYesList of objects, or '*' for all objects in source schema.
includeNoboth
if_existsNoBehavior when a target object already exists.error
data_strategyNoinsert_batches
dry_runNoGenerate SQL without applying. Use with output_file.
output_fileNoWhen dry_run is true, write generated SQL to this .sql path.

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: modes, if_exists handling, dry_run SQL generation, FK constraint ordering, and security/readonly checks, leaving no ambiguity.

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?

The description is slightly verbose but well-structured with front-loaded main purpose and detailed specifics; every sentence adds value, though some redundancy exists (e.g., 'both endpoints must be configured servers' repeated).

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?

Given complexity (8 params, no output schema), the description covers all key aspects: modes, conflict resolution, dry run, security, readonly enforcement, and FK handling, making it self-contained and complete.

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 coverage is 75%; the description explains the purpose of 'include', 'if_exists', 'dry_run', and 'output_file' beyond the schema, clarifying their interaction and constraints.

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 transfers DDL and/or data between servers/databases, specifying modes ('ddl', 'data', 'both'), which distinguishes it from sibling tools like 'export_to_sql_file' or 'execute_sql'.

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?

Provides conditions: endpoints must be configured servers, refuses if target is readonly, and mentions security (no ad-hoc connection strings). However, it lacks explicit comparison to alternatives or when not to use this tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 36 tool updatesv3.0.3
    • First observedanalyze_db_health
    • First observedanalyze_query_indexes
    • First observedanalyze_workload_indexes
    • First observedbatch_execute
    • First observedbegin_transaction
    • First observedcolumn_profile
    • First observedcommit_transaction
    • First observeddescribe_table
    • First observeddetect_migration_state
    • First observeddry_run_sql_file
    • First observedexecute_sql
    • First observedexecute_sql_file
    • First observedexplain_query
    • First observedexport_to_sql_file
    • First observedfind_blocking_queries
    • First observedfind_dependents
    • First observedgenerate_seed_data
    • First observedget_current_connection
    • First observedget_object_details
    • First observedget_top_queries
    • First observedget_transaction_info
    • First observedkill_query
    • First observedlist_databases
    • First observedlist_objects
    • First observedlist_schemas
    • First observedlist_servers
    • First observedlist_transactions
    • First observedlock_check
    • First observedmutation_dry_run
    • First observedmutation_preview
    • First observedpreview_sql_file
    • First observedrollback_transaction
    • First observedsafe_alter_table
    • First observedschema_diff
    • First observedswitch_server_db
    • First observedtransfer_objects

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a distinct purpose with clear descriptions. Overlaps like mutation_dry_run and mutation_preview are intentionally differentiated by execution style. No two tools are easily confused.

Naming Consistency5/5

All tools use snake_case with a consistent verb_noun pattern (e.g., analyze_db_health, execute_sql, begin_transaction). No mixing of casing or verb styles.

Tool Count2/5

With 36 tools, the set is heavily packed. While the domain is broad, this exceeds the 25-tool threshold for 'too many' per guidelines, potentially overwhelming agents.

Completeness5/5

The tool surface covers virtually all Postgres management needs: connection, querying, transactions, health, indexing, migrations, DDL safety, and data transfer. Only niche features (e.g., user management) are absent.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables secure querying of PostgreSQL databases through MCP-compatible clients. Supports read-only SQL execution, table exploration, and connection management with built-in security validation.
    3
    41
    9
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with PostgreSQL databases through MCP, allowing users to explore database structures, inspect table schemas, and execute read-only SQL queries.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables users to perform SQL query execution, schema exploration, and performance analysis on PostgreSQL databases through any MCP-compatible client. It prioritizes security with read-only protection by default and provides guided workflows for database documentation and optimization.
    -
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables interaction with PostgreSQL databases through MCP, supporting queries, DDL, DML, and schema inspection.
    6
    MIT

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