PostgreSQL MCP Server
Provides 36 tools for interacting with PostgreSQL databases, including schema introspection, query execution, data exploration, performance monitoring, security auditing, and maintenance.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostgreSQL MCP Serverdescribe the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
postgresql-mcp-server – MCP Server for PostgreSQL
Full-featured MCP (Model Context Protocol) server that exposes 36 tools for interacting with PostgreSQL databases. Covers schema introspection, query execution, data exploration, performance monitoring, security auditing, and maintenance — all accessible from Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.
Table of Contents
Related MCP server: postgres-mcp
Features
36 tools across 6 domains: schema, queries, data, monitoring, security, maintenance
Dual transport: HTTP (Docker/remote) and stdio (local subprocess)
Read-only enforcement:
pg_queryrejects non-SELECT statements at the application levelDestructive-op guards: DROP, TRUNCATE, DELETE-without-WHERE require explicit
confirm_destructive: truePagination + truncation: all list tools respect
limit/offset; responses capped at 25,000 charsDual output formats: every tool supports
response_format: markdown(default) orjsonDemo schema: first-run seed with users, products, orders, triggers, views, and indexes
Requirements
Docker + Docker Compose (recommended) — or Node.js 20+ for local run
PostgreSQL 13+ (16 included in Docker setup)
An MCP-compatible client (Claude Code, Claude Desktop, Cursor…)
Quick Start (Docker)
# 1. Clone / enter project
cd mcp-postgresql
# 2. Start PostgreSQL + MCP server
docker compose up -d
# 3. Verify both containers are healthy
docker compose psDefault ports:
Service | Port | Description |
PostgreSQL |
| Exposed to host for direct psql access |
MCP HTTP server |
| MCP endpoint at |
Default credentials
Host: localhost:5432
Database: mcpdb
User: mcpuser
Password: mcppasswordOverride via .env:
POSTGRES_USER=myuser
POSTGRES_PASSWORD=mysecret
POSTGRES_DB=mydb
PG_PORT=5432
MCP_PORT=3002Demo schema
On first start, init/01_demo_schema.sql is executed automatically, creating:
Tables:
users,products,orders,order_items,audit_logViews:
active_users,order_summaryFunction + triggers:
update_updated_at()7 indexes, seed data (5 users, 5 products)
Extensions:
uuid-ossp,pg_stat_statements
Configuration
Environment variables
Variable | Default | Description |
| — | Full connection string (overrides all PG_* vars) |
|
| PostgreSQL host |
|
| PostgreSQL port |
|
| Database name |
|
| PostgreSQL user |
| — | PostgreSQL password |
|
|
|
|
| HTTP server port (when |
|
| HTTP bind address ( |
Tools Reference
Schema Introspection
Tool | Description |
| All databases with encoding and size |
| Schemas with owner, table/view counts |
| Tables in schema with size and estimated row count |
| Full table description: columns, FK, indexes, check constraints |
| Views and materialized views with optional SQL definitions |
| Functions, procedures, aggregates, window functions |
| Indexes by schema/table with size and definition |
| Installed PostgreSQL extensions |
| Sequences with range, increment, and current value |
| Triggers per table with timing and event |
| Enums, composite types, domains, range types |
| Partitioned tables and their child partitions |
| Search all DB objects by LIKE pattern across all types |
| CREATE statement (DDL) for table, view, function, or index |
Query Execution
Tool | Description |
| Execute a SELECT query (rejects any non-read-only statement) |
| EXPLAIN or EXPLAIN ANALYZE with text or JSON output |
| Execute DML/DDL: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP |
| Execute multiple statements atomically in a single transaction |
Data Exploration
Tool | Description |
| Sample rows from a table with optional WHERE, ORDER BY, column filter |
| Exact COUNT(*) with optional WHERE clause |
| Export query results as CSV with header row |
| Size, live/dead rows, vacuum dates, scan counts per table |
Monitoring & Performance
Tool | Description |
| Currently running queries with duration and wait events |
| Slow query analysis from |
| Index scan counts — identify unused or underused indexes |
| Tables with high dead-tuple ratios needing VACUUM |
| Active locks with blocking pair detection |
| Streaming replica status and replay lag |
| Connection summary grouped by database, user, app, or state |
Security & Access Control
Tool | Description |
| All roles with attributes: superuser, login, replication, bypassRLS, memberships |
| Privileges on tables, views, sequences, functions |
| Row Level Security policies and RLS-enabled tables |
| Cancel (SIGINT) or terminate (SIGTERM) a backend by PID |
Maintenance & Configuration
Tool | Description |
| Server version, uptime, connection counts, key settings |
|
|
| Run VACUUM, VACUUM ANALYZE, or VACUUM FULL on a table |
Client Setup
Claude Code
# Register via HTTP (Docker must be running)
claude mcp add --transport http postgresql-mcp-server http://localhost:3002/mcpClaude Desktop
Claude Desktop requires stdio transport. Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"postgresql": {
"command": "node",
"args": ["/absolute/path/to/mcp-postgresql/dist/index.js"],
"env": {
"DATABASE_URL": "postgres://mcpuser:mcppassword@localhost:5432/mcpdb"
}
}
}
}Restart Claude Desktop after editing.
Cursor
Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level):
{
"mcpServers": {
"postgresql": {
"url": "http://localhost:3002/mcp"
}
}
}Transport Modes
Mode | When to use | How to run |
HTTP | Docker, remote servers, multiple clients |
|
stdio | Claude Desktop, local subprocess, single client |
|
DNS rebinding note: when running HTTP locally (outside Docker), the server binds to 127.0.0.1 by default. In Docker, set HOST=0.0.0.0 (already set in docker-compose.yml).
Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run locally (stdio, connects to DATABASE_URL)
DATABASE_URL=postgres://user:pass@localhost:5432/mydb npm start
# Run as HTTP server
TRANSPORT=http PORT=3000 DATABASE_URL=... npm start
# Watch mode (dev)
DATABASE_URL=... npm run devDocker commands
# Start
docker compose up -d
# Stop (keep volumes)
docker compose down
# Stop and wipe database
docker compose down -v
# Rebuild after code changes
docker compose up --build -d
# Follow logs
docker compose logs -f mcp-serverAdding tools
Create or edit a file in
src/tools/Export a
register*Tools(server: McpServer)functionImport and call it in
src/index.tsnpm run build— TypeScript strict mode catches issues at compile timedocker compose up --build -dto deploy
Project Structure
mcp-postgresql/
├── src/
│ ├── index.ts # Entry point — registers all tools, starts transport
│ ├── constants.ts # CHARACTER_LIMIT, defaults, ResponseFormat enum
│ ├── types.ts # TypeScript interfaces for all DB result rows
│ ├── db.ts # pg.Pool, dbQuery, quoteIdentifier, validateIdentifier
│ ├── tools/
│ │ ├── schema.ts # pg_list_databases/schemas/tables/views/functions/indexes/extensions/sequences/triggers/types/partitions/search/ddl/describe
│ │ ├── query.ts # pg_query, pg_explain, pg_execute, pg_transaction
│ │ ├── data.ts # pg_sample_rows, pg_count_rows, pg_table_stats, pg_copy_csv
│ │ ├── advanced.ts # pg_server_info, pg_list_locks, pg_get_ddl
│ │ ├── monitoring.ts # pg_active_queries, pg_slow_queries, pg_index_usage, pg_bloat_report, pg_replication_status
│ │ ├── security.ts # pg_list_types/grants/policies/partitions, pg_copy_csv, pg_kill_query
│ │ └── maintenance.ts # pg_list_roles, pg_list_settings, pg_vacuum, pg_connection_stats
│ └── utils/
│ ├── errors.ts # PostgreSQL error formatting, isPgError type guard
│ └── format.ts # formatMarkdownTable, truncateIfNeeded, formatBytes
├── init/
│ └── 01_demo_schema.sql # Auto-loaded on first container start
├── dist/ # Compiled JavaScript (gitignored)
├── Dockerfile # Multi-stage: builder → runtime (node:20-alpine)
├── docker-compose.yml # postgres:16-alpine + mcp-server
├── .env # Local overrides (not committed)
├── .dockerignore
├── package.json
└── tsconfig.jsonSafety Model
Operation | Protection |
SELECT via | Rejects INSERT/UPDATE/DELETE/DDL at app level |
DROP / TRUNCATE | Requires |
DELETE without WHERE | Requires |
VACUUM FULL | Requires |
| Shows target query before acting; requires explicit mode |
Identifier injection |
|
Available Tools
36 toolspg_active_queriesShow Active PostgreSQL QueriesARead-only
List all currently running queries in the database (excludes idle connections and the MCP server itself).
Args:
min_duration_seconds: Only show queries running longer than N seconds (default: 0 = all active)
include_idle_in_transaction: Include connections stuck in idle-in-transaction state (default: true)
response_format: Output format
Returns: JSON: { queries: ActiveQuery[], count: number } Markdown: table with PID, user, state, wait event, duration, query text
Useful for finding long-running queries, blocked transactions, and identifying performance bottlenecks.
| Name | Required | Description | Default |
|---|---|---|---|
| min_duration_seconds | No | Minimum query duration in seconds (0 = all) | |
| include_idle_in_transaction | No | Include idle-in-transaction connections | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds behavioral context beyond annotations, such as excluding idle connections and the server itself, and details default parameter behavior. Annotations already indicate read-only and non-destructive, which the description reinforces without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with clear sections for description, arguments, and returns. Every sentence provides essential information without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking an output schema, the description fully explains the return format in both JSON (with fields) and Markdown (table columns), covering all necessary details for a monitoring tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the description adds value by clarifying defaults and the purpose of each parameter, e.g., 'default: 0 = all active' for min_duration_seconds and the output format options for response_format.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
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 'queries', with specific exclusions (idle connections and the MCP server itself). It distinguishes itself from sibling tools like pg_slow_queries by focusing on currently running queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states use cases: 'finding long-running queries, blocked transactions, and identifying performance bottlenecks.' However, it does not explicitly mention when not to use it or provide alternatives among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_bloat_reportTable Bloat ReportARead-only
Identify tables with high dead-tuple ratios that need VACUUM or AUTOVACUUM attention.
Dead rows accumulate from UPDATE and DELETE operations. High dead% degrades query performance and wastes storage. Tables over ~20% dead tuples should be vacuumed.
Args:
schema: Filter to a specific schema (optional)
min_dead_pct: Minimum dead tuple % to include (default: 5)
min_dead_rows: Minimum absolute dead row count (default: 1000)
response_format: Output format
Returns: JSON: { tables: BloatInfo[], count: number } Markdown: table sorted by dead% descending, with last vacuum dates
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Filter to schema (optional) | |
| min_dead_pct | No | Minimum dead row % threshold | |
| min_dead_rows | No | Minimum dead row count threshold | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and destructiveHint=false. Description adds context about dead-tuple accumulation from UPDATE/DELETE and its impact on query performance and storage, which is beyond the annotations. No contradiction; behavior is well disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is front-loaded with main purpose and uses a structured docstring format (Args/Returns). It is concise but could be slightly more streamlined; every sentence adds value. Well-organized for quick scanning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, description explicitly documents return formats (JSON with BloatInfo fields and count, Markdown sorted by dead%) and includes threshold defaults. Covers all necessary context: purpose, parameter explanations, behavioral impact, and output shape. Fully adequate for a reporting tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description reiterates parameter names and default values similarly to schema, but adds minimal extra context (e.g., 'Filter to a specific schema (optional)'). Not enough added value to raise score above baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool identifies tables with high dead-tuple ratios needing vacuum attention. It uses specific verb 'identify' and resource 'tables... that need VACUUM or AUTOVACUUM attention', distinguishing it from sibling tools like pg_vacuum (performs vacuum) or pg_table_stats (general stats). Includes context on dead row accumulation and performance impact.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description explains when to use (to find tables needing vacuum) and provides a threshold guideline ('Tables over ~20% dead tuples should be vacuumed'). However, it does not explicitly state when not to use or mention alternatives among siblings. Clear context with reasonable exclusion missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_connection_statsPostgreSQL Connection StatisticsARead-only
Show a summary of current connections grouped by database, user, application, and state.
Useful for monitoring connection pool utilization, finding idle connections, and detecting connection leaks from specific applications.
Args:
group_by: Group connections by 'database', 'user', 'application', or 'state' (default: state)
database: Filter to a specific database (optional)
response_format: Output format
Returns: JSON: { summary: ConnectionStat[], total_connections: number, max_connections: string, usage_pct: number } Markdown: grouped connection count with waiting and max idle age
Note: Excludes the MCP server's own backend connection from counts.
| Name | Required | Description | Default |
|---|---|---|---|
| group_by | No | Group connections by 'database', 'user', 'application', or 'state' | state |
| database | No | Filter to specific database (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (readOnlyHint=true, destructiveHint=false), the description adds important behavioral context: it excludes the MCP server's own backend connection from counts, and details the output format for both JSON and Markdown. This helps the AI agent understand exactly what the tool returns and its non-destructive nature.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a brief purpose statement, followed by use cases, a clear Args section, a Returns section, and a critical note. Every sentence adds value, and there is no redundancy with the input schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is no output schema, the description fully compensates by detailing the return structure for both JSON and Markdown formats. The tool has 3 parameters, all documented, and the description includes a note about connection exclusion. This is comprehensive for a read-only diagnostic tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description restates the parameters and their defaults but adds no new semantic detail beyond what the schema already provides. For example, the group_by enum values are listed in both places. No additional constraints or examples are given.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool shows a summary of current PostgreSQL connections grouped by database, user, application, or state. It specifies the resource (connection statistics) and action (show summary), distinguishing it from sibling tools like pg_active_queries which focuses on active queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states use cases: monitoring connection pool utilization, finding idle connections, and detecting connection leaks. While it doesn't list when not to use or directly name alternatives, the context signals and sibling tools list imply that for different monitoring needs (e.g., active queries) other tools exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_copy_csvExport Query Results as CSVARead-only
Execute a SELECT query and return the results formatted as CSV with headers.
Args:
sql: SELECT statement to export (required — must be read-only)
limit: Maximum rows to export, 1-5000 (default: 1000)
delimiter: CSV field delimiter character (default: ',')
null_value: String to use for NULL values in CSV output (default: '')
Returns: CSV text with header row. Suitable for copy-paste into spreadsheets or piping to files.
Errors:
Rejected if non-SELECT statement provided
Returns error if query fails
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SELECT query to export as CSV | |
| limit | No | Max rows (default: 1000, max: 5000) | |
| delimiter | No | CSV delimiter character (default: comma) | , |
| null_value | No | Value to use for NULL fields |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint and destructiveHint. The description goes beyond by detailing the CSV output format, error handling for invalid queries, and parameters like limit, delimiter, and null_value. No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with clear sections (Args, Returns, Errors), uses bullet points, and is concise—every sentence provides essential information without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully covers return value (CSV text), all parameters, constraints (SELECT only, row limit), and error cases. It is complete for a tool of this complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 100% schema coverage, the description adds substantial meaning: sql is required and must be read-only; limit range and default; delimiter default character; null_value default. This enriches the agent's understanding beyond schema constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Execute a SELECT query and return the results formatted as CSV with headers,' specifying a concrete verb and resource. The title 'Export Query Results as CSV' distinguishes it from siblings like pg_execute and pg_query, which likely return different formats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes explicit notes on when to use (SELECT only) and error conditions for non-SELECT. However, it does not explicitly compare against sibling tools like pg_execute or pg_query to guide selection for similar operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_count_rowsCount Rows in TableARead-only
Get exact row count for a table, optionally with a filter condition.
Args:
table: Table name (required)
schema: Schema name (default: public)
where_clause: Optional WHERE condition (without the WHERE keyword)
Returns: JSON: { table, schema, count, where_clause } Markdown: formatted count with filter info
Note: For large tables (>10M rows), pg_table_stats provides a faster estimated count.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name | |
| schema | No | PostgreSQL schema name (default: public) | public |
| where_clause | No | Optional WHERE condition without 'WHERE', e.g. "status = 'active'" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds value by specifying that it provides an exact count, supports optional WHERE clause, and includes a large-table performance note. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise and well-structured: main purpose sentence, then Args/Returns/Note sections. Every sentence adds value; no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With annotations and simple output, description fully covers behavior: exact count, filter usage, return format, and alternative for large tables. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description repeats parameter names and meanings from schema (e.g., 'table: Table name (required)') without adding new semantic details or format constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Get exact row count for a table', using specific verb 'Get' and resource 'row count'. It distinguishes from sibling tool 'pg_table_stats' which provides estimated counts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides a usage alternative: 'For large tables (>10M rows), pg_table_stats provides a faster estimated count.' Also mentions optional filter condition, guiding appropriate use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_describe_tableDescribe PostgreSQL TableARead-onlyIdempotent
Full description of a table: columns, data types, constraints, indexes, and foreign keys.
Args:
table: Table name (required)
schema: Schema name (default: public)
response_format: Output format
Returns: JSON: { table, schema, columns: ColumnInfo[], foreign_keys: ForeignKeyInfo[], check_constraints, indexes: IndexInfo[] } Markdown: multi-section formatted description
Errors:
"Table not found" if table/schema doesn't exist
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name | |
| schema | No | PostgreSQL schema name (default: public) | public |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds that the tool returns JSON or Markdown and lists possible errors. It does not disclose additional behavioral traits beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with clear sections for Args, Returns, and Errors. Every sentence is informative without unnecessary words. It is well-structured and front-loaded with the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description fully explains the tool's functionality, inputs, return formats, and error cases. Despite lacking an output schema, it details both JSON and Markdown output structures, making it complete for a read-only describe tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 repeats parameter explanations (table name, schema default, response_format enum) but adds minor context like default values and error messages. It 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.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it provides a full description of a table including columns, data types, constraints, indexes, and foreign keys. It uses specific verbs and resource, distinguishing it from sibling tools like pg_list_tables or pg_get_ddl.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains the usage context (table name, optional schema, format) and expected outputs. However, it does not explicitly state when to use this tool versus alternatives among the many sibling tools, though the purpose is clear enough for inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_executeExecute SQL Statement (Write Operations)ADestructive
Execute a non-SELECT SQL statement: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, etc.
For DROP, TRUNCATE, or DELETE without a WHERE clause, you must set confirm_destructive: true to confirm you understand these operations are irreversible.
Args:
sql: SQL statement to execute (required)
confirm_destructive: Required for DROP/TRUNCATE/DELETE without WHERE (default: false)
timeout_ms: Statement timeout in milliseconds (default: 30000)
Returns: JSON: { command, rows_affected, duration_ms } Markdown: summary of executed statement
Examples:
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')
UPDATE orders SET status = 'shipped' WHERE id = 42
CREATE INDEX idx_users_email ON users(email)
DROP TABLE temp_data (requires confirm_destructive: true)
Warning: Mutations are not automatically wrapped in a transaction. Use BEGIN/COMMIT explicitly for multi-statement transactions.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL statement to execute | |
| confirm_destructive | No | Set true to confirm DROP/TRUNCATE/DELETE-without-WHERE operations | |
| timeout_ms | No | Statement timeout in milliseconds |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare destructiveHint=true and readOnlyHint=false. The description adds crucial context: irreversible operations require confirm_destructive, no auto-transaction, and the return format (JSON with command, rows_affected, duration_ms, plus Markdown). This goes beyond annotations to disclose important 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with clear sections: purpose, special conditions, Args, Returns, Examples, Warning. Each sentence serves a purpose without redundancy. It is concise yet comprehensive, fitting within a few lines.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description fully covers the tool's behavior: what it does (write operations), special confirm_destructive requirement, timeout parameter, return format, and transaction warning. Given the absence of output schema, the return description is sufficient. The sibling context further clarifies the tool's role.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% description coverage, so baseline is 3. The description adds value by explaining the role of confirm_destructive (required for certain operations) and providing examples that illustrate parameter usage. It does not repeat schema information unnecessarily.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Execute a non-SELECT SQL statement' and lists specific operations (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE). This distinguishes it from sibling tools like pg_query (for SELECT) and other specialized tools. The verb 'Execute' and resource 'SQL Statement' are specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use confirm_destructive for DROP/TRUNCATE/DELETE without WHERE. It warns about lack of automatic transaction wrapping. While it doesn't explicitly say 'use pg_query for SELECT', the phrase 'non-SELECT' strongly implies it. The examples cover common use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_explainExplain SQL Query PlanARead-only
Show the execution plan for a SQL query using EXPLAIN or EXPLAIN ANALYZE.
Use EXPLAIN to see the planned query strategy. Use EXPLAIN ANALYZE to actually execute the query and see real timing and row count statistics (costs real I/O).
Args:
sql: SQL query to explain (required, should be a SELECT)
analyze: Run EXPLAIN ANALYZE (executes the query, default: false)
buffers: Include buffer usage statistics — only with analyze:true (default: false)
format: Output format for the plan, 'text' or 'json' (default: text)
response_format: Response format
Returns: The query plan as text or JSON. Use 'json' format for programmatic parsing.
Warning: EXPLAIN ANALYZE actually executes the query, including any side effects.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query to explain | |
| analyze | No | Run EXPLAIN ANALYZE (executes the query) | |
| buffers | No | Include buffer stats (only with analyze: true) | |
| format | No | Plan format: 'text' or 'json' | text |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description warns that EXPLAIN ANALYZE executes the query with potential side effects, contradicting the readOnlyHint: true annotation which asserts the tool is read-only. This is a critical inconsistency that undermines trust.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (about 10 lines) with clear sections (Args, Returns, Warning), front-loaded with the main purpose. Every sentence adds value, no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity and no output schema, the description covers all key aspects: parameters, return format, and a critical warning about side effects. It is complete for an agent to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context beyond the schema, explaining the difference between sql and analyze, the dependency of buffers on analyze, and the format options. Schema coverage is 100%, so the baseline is 3, and the description provides extra clarity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Show the execution plan for a SQL query using EXPLAIN or EXPLAIN ANALYZE', which is a specific verb (show) and resource (execution plan). It distinguishes from siblings like pg_execute (which runs queries) by focusing on plan analysis.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use EXPLAIN vs EXPLAIN ANALYZE, providing clear context on the trade-offs (planned strategy vs real execution with I/O cost). However, it does not explicitly compare with sibling tools or state 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.
pg_get_ddlGet DDL (CREATE statement) for a Database ObjectARead-onlyIdempotent
Get the CREATE statement (DDL) for a table, view, materialized view, function, or index.
Args:
object_name: Name of the object (required)
schema: Schema name (default: public)
object_type: Type of object: 'table', 'view', 'matview', 'function', 'index' (default: 'table')
Returns: JSON: { schema, object_name, object_type, ddl: string } Markdown: formatted SQL code block
Useful for understanding table structure, reproducing objects in other environments, or code review.
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | Name of the object | |
| schema | No | PostgreSQL schema name (default: public) | public |
| object_type | No | Object type: 'table', 'view', 'matview', 'function', 'index' | table |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds return format details (JSON fields, Markdown code block) and lists supported object types, enhancing transparency beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two paragraphs: a purpose sentence, then args, return format, and usage. It is front-loaded with the essential action and well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite no output schema, the description explains the return JSON fields and Markdown formatting. It covers tool purpose, parameters, return, and usage scenarios fully, given the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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's 'Args:' section mirrors the schema and adds readability but does not provide new semantic meaning beyond what the schema already conveys.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies the verb 'Get' and the resource 'CREATE statement (DDL)' for multiple object types. It clearly distinguishes from sibling tools like pg_describe_table or pg_list_tables by focusing on DDL retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states use cases: 'understanding table structure, reproducing objects in other environments, or code review.' It does not mention when not to use or alternatives, but sibling differentiation is inherent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_index_usageAnalyze Index Usage StatisticsARead-only
Show index scan counts and tuple statistics to identify unused or underused indexes.
Indexes with 0 scans that are not primary keys waste storage and slow writes — candidates for removal.
Args:
schema: Filter to a specific schema (optional)
min_table_size_mb: Only show indexes on tables larger than N MB (default: 0)
show_unused_only: Only show indexes with 0 scans (default: false)
response_format: Output format
Returns: JSON: { indexes: IndexUsage[], count: number } Markdown: table sorted by scan count ascending (least used first)
Note: Statistics reset on pg_stat_reset() or server restart. Low scans on a new server may not mean unused.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Filter to schema (optional) | |
| min_table_size_mb | No | Minimum table size in MB to include | |
| show_unused_only | No | Only show indexes with 0 scans | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds valuable behavioral context: statistics reset on pg_stat_reset() or server restart, and low scans on new server may not indicate unused. This goes beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured: one-line summary, motivational sentence, Args list, Returns section, behavioral note. Every sentence adds value. Front-loaded with key purpose. No fluff or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Completeness given complexity: no output schema but description specifies return formats (JSON and Markdown) with sorting details for Markdown. Covers behavioral notes and all parameters. Standalone sufficient for agent to understand and invoke tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema covers all 4 parameters with descriptions (100% coverage). Description repeats parameters in Args block with slight additional context (e.g., emphasis on filtering for unused indexes). Does not significantly add meaning beyond schema, but integrates parameters into the overall purpose. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Show index scan counts and tuple statistics to identify unused or underused indexes.' It uses a specific verb and resource, and distinguishes from sibling tools like pg_list_indexes (listing) and pg_bloat_report (bloat).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides clear context for usage: identifying unused/underused indexes, mentions that indexes with 0 scans and not primary keys waste storage. Notes limitations about statistics reset and new server interpretation. Lacks explicit comparison to alternatives but sufficiently guides appropriate usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_kill_queryCancel or Terminate a PostgreSQL BackendADestructive
Cancel or terminate a PostgreSQL backend process by PID.
Two modes:
cancel (safe): Sends SIGINT — cancels the current query but leaves the connection alive. The client can reconnect and retry.
terminate (forceful): Sends SIGTERM — kills the connection entirely. Use when cancel doesn't work.
Args:
pid: Process ID of the backend to cancel/terminate (from pg_active_queries or pg_list_locks)
mode: 'cancel' to cancel current query, 'terminate' to kill connection (default: cancel)
Returns: Whether the signal was successfully sent.
Note: You cannot cancel/terminate your own backend or superuser backends without superuser privileges.
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Backend PID to cancel or terminate | |
| mode | No | 'cancel' = cancel query, 'terminate' = kill connection | cancel |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark destructiveHint=true, but the description elaborates: cancel sends SIGINT (safe, connection stays), terminate sends SIGTERM (forceful, connection killed). Also states it cannot kill own backend or superuser without privileges. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Highly concise: one sentence for purpose, then clear sections for modes, args, returns, and note. Every sentence adds essential information with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite no output schema, the description covers return value ('Whether the signal was successfully sent'), edge cases (own backend, superuser), and sources for the PID. This is comprehensive for a straightforward kill tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds value by specifying that pid comes from pgs_active_queries or pg_list_locks, and explaining the two mode values with their default. This goes beyond the schema's basic descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The title and first sentence clearly state that the tool cancels or terminates a PostgreSQL backend by PID. It distinguishes two modes (cancel vs terminate) and explains their effects. No sibling tool does this, so purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly describes when to use cancel (safe, leaves connection alive) vs terminate (when cancel doesn't work). Notes that PID comes from sibling tools (pg_active_queries, pg_list_locks) and warns about privilege limitations. This gives agents clear decision criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_databasesList PostgreSQL DatabasesARead-onlyIdempotent
List all non-template databases accessible on the connected PostgreSQL server.
Returns database name, encoding, collation, size, and connection limit.
Returns: JSON: { databases: DatabaseInfo[], count: number } Markdown: formatted table
Errors:
"Cannot connect" if DATABASE_URL/PG_* env vars are wrong
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, destructiveHint, idempotentHint. The description adds return fields (name, encoding, collation, size, connection limit), output formats (JSON/Markdown), and error conditions, which provides additional behavioral context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief, structured with sections for returns and errors, and contains no unnecessary words. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully explains return values and errors. For a simple tool with one optional parameter, it covers all necessary information for an agent to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with one parameter (response_format). The description explains the effect of the parameter by detailing the return formats (JSON vs Markdown table), adding meaning beyond the enum values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action 'List all non-template databases accessible on the connected PostgreSQL server', distinguishing it from sibling tools that list other objects (tables, schemas, roles, etc.).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for listing databases, and no sibling tool provides this exact functionality, so the context is clear. However, it doesn't explicitly state when not to use it or mention alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_extensionsList Installed PostgreSQL ExtensionsARead-onlyIdempotent
List all extensions currently installed in the PostgreSQL database.
Returns extension name, installed version, default version, and description.
Returns: JSON: { extensions: ExtensionInfo[], count: number } Markdown: formatted table
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the description doesn't need to restate those. However, it adds useful details about the return format (JSON/Markdown) and the fields included (name, installed version, etc.), which enhances transparency beyond 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long, front-loaded with the action ('List all extensions'), and efficiently conveys the return format and fields. Every sentence serves a purpose without unnecessary verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (1 optional parameter, no output schema), the description is complete. It explains the output format and content, and the parameter is already well-documented in the schema. No additional information is needed for an agent to use this tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with the single parameter 'response_format' fully described (enum, default, description). The description does not add additional semantics beyond what the schema provides, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List all extensions currently installed in the PostgreSQL database' with a specific verb and resource. It distinguishes itself from sibling tools (e.g., pg_list_tables, pg_list_databases) by focusing on extensions, leaving no ambiguity about what it does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description makes it clear that this tool is for listing extensions, which is straightforward given the tool name and title. While it does not explicitly state when to avoid using it or name alternative tools, the context of sibling tools provides sufficient differentiation for an agent to select the correct tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_functionsList Functions and ProceduresARead-onlyIdempotent
List all user-defined functions, procedures, aggregates, and window functions in a schema.
Args:
schema: Schema name (default: public)
response_format: Output format
Returns: JSON: { functions: FunctionInfo[], count: number, schema: string } Markdown: formatted table with name, type, return type, arguments, language
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate read-only, non-destructive, idempotent behavior. The description adds context about return formats (JSON or Markdown) and the specific types of functions listed, which goes beyond annotations without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the main purpose. It includes structured 'Args:' and 'Returns:' sections, which is helpful but slightly redundant with the schema. No wasted sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description fully specifies the return structure for both JSON and Markdown formats. It also covers the default schema, making the tool's behavior completely understandable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Both parameters are well-documented in the input schema (100% coverage). The description restates them with defaults and return format options, adding minimal additional meaning beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists user-defined functions, procedures, aggregates, and window functions in a schema. This is specific and distinguishes it from other pg_list_* tools like pg_list_tables, pg_list_triggers, etc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for listing functions in a schema but does not explicitly provide when-to-use or alternatives. Context from sibling tools helps, but no direct guidance is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_grantsList Grants and PrivilegesARead-onlyIdempotent
Show all privileges granted on tables, views, sequences, and functions in a schema.
Args:
schema: Schema name (default: public)
object_name: Filter to a specific object (optional)
grantee: Filter by role/user name (optional)
response_format: Output format
Returns: JSON: { grants: GrantInfo[], count: number } Markdown: table with grantor, grantee, object, privilege type, and grantable flag
Useful for security audits and understanding who has access to what.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| object_name | No | Filter to specific object (optional) | |
| grantee | No | Filter by grantee role name (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint, destructiveHint, and idempotentHint, but the description adds context about the return format (JSON vs Markdown) and the types of objects covered. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with Args and Returns sections but is slightly verbose. It could be more concise while retaining all necessary details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite no output schema, the description fully explains the return structure (JSON with grants array and count, Markdown table with specific columns), covering all needed context for a read-only tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the schema already includes clear descriptions for each parameter. The description's Args section adds minimal new information beyond restating the schema fields.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists privileges on tables, views, sequences, and functions in a schema. It uses specific verbs ('show all privileges') and distinguishes from sibling tools like pg_list_roles and pg_list_schemas by focusing on grants.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions the tool is useful for security audits and understanding access, providing a clear use case. However, it does not explicitly state when not to use it or contrast with alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_indexesList PostgreSQL IndexesARead-onlyIdempotent
List indexes in a schema, optionally filtered to a specific table.
Args:
schema: Schema name (default: public)
table: Filter to a specific table (optional)
response_format: Output format
Returns: JSON: { indexes: IndexInfo[], count: number } Markdown: formatted table with name, table, type, uniqueness, size, definition
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| table | No | Filter to this table only (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds value by detailing the return formats (JSON and Markdown) and structure, which goes beyond what annotations provide. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with separate Args and Returns sections, but it is slightly redundant with the schema. Every sentence serves a purpose, and it is front-loaded with the main action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given full schema coverage, annotations, and clear purpose, the description is complete. It explains return formats and structure, which compensates for the lack of an output schema. Edge cases like empty results are not covered but are not critical for a list tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all three parameters. The description's Args section largely repeats schema info, adding little new meaning. Baseline of 3 is appropriate since the schema already does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'List indexes in a schema, optionally filtered to a specific table.' The verb 'List' combined with the resource 'indexes' and optional table filter makes it distinctive from sibling tools like pg_describe_table or pg_index_usage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use (listing indexes, optionally filtered). It doesn't explicitly state when not to use or alternatives, but the context of sibling tools and the straightforward purpose imply proper usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_locksList Current PostgreSQL LocksARead-only
Show currently active locks in the database, including waiting queries.
Useful for debugging lock contention, deadlocks, and long-running transactions.
Args:
include_granted: Include granted locks (not just waiting) — default: true
response_format: Output format
Returns: JSON: { locks: LockInfo[], blocking_pairs: [{blocker_pid, blocked_pid}] } Markdown: lock table with PID, query, lock type, relation, and wait status
Note: Requires sufficient privileges to view pg_stat_activity.
| Name | Required | Description | Default |
|---|---|---|---|
| include_granted | No | Include already-granted locks (not just blocked) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds useful behavioral context: privilege requirement, output format options, and the effect of the include_granted parameter. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear summary, usage line, argument list, returns section, and note. Every sentence adds value, and it is appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 optional parameters, good annotations, and no output schema, the description fairly complete. It explains the output structure for both JSON and Markdown formats. Minor gap: no detailed column list, but overall sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description explains both parameters (include_granted and response_format) with defaults and their role. It adds meaning beyond schema by stating defaults and context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it shows currently active locks and waiting queries, using specific verb 'Show' and resource 'locks'. It distinguishes itself from sibling tools like pg_active_queries by focusing on lock contention, deadlocks, and long-running transactions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly mentions debugging lock contention, deadlocks, and long-running transactions. It also notes the privilege requirement. However, it does not provide explicit when-not-to-use guidance or contrast with alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_partitionsList Table PartitionsARead-onlyIdempotent
List all partitioned tables and their child partitions with bounds, size, and row estimates.
Args:
schema: Filter to a specific schema (optional)
parent_table: Filter to a specific partitioned table (optional)
response_format: Output format
Returns: JSON: { partitions: PartitionInfo[], parent_tables: string[] } Markdown: grouped by parent table, showing each partition's bounds and size
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Filter to schema (optional) | |
| parent_table | No | Filter to a specific partitioned table (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint, destructiveHint, idempotentHint. The description adds value by detailing what the tool returns (bounds, size, row estimates) and the output formats, but does not disclose additional behavioral traits beyond those annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two short paragraphs), front-loaded with the main action, and efficiently lists Args and Returns without extraneous text. Every sentence serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only listing tool with no output schema, the description explains the output structure (JSON and Markdown). All parameters are documented. Minor gaps: no mention of behavior when no partitions or invalid filters, but generally complete for its simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 repeats parameter purposes and adds default for response_format, but does not significantly enhance understanding beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with a specific verb ('List all partitioned tables and their child partitions') and clearly states the resource and attributes (bounds, size, row estimates). It distinguishes itself from all sibling pg_list_* tools, as none list partitions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for partition listing but does not explicitly state when to use vs alternatives, nor does it provide when-not or exclusion criteria. Usage is clear from context but not explicitly guided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_policiesList Row Level Security PoliciesARead-onlyIdempotent
List all Row Level Security (RLS) policies in a schema, including USING and WITH CHECK expressions.
Args:
schema: Schema name (default: public)
table: Filter to a specific table (optional)
response_format: Output format
Returns: JSON: { policies: PolicyInfo[], count: number, rls_enabled_tables: string[] } Markdown: policy table with name, command, roles, permissive flag, and filter expressions
Note: Also shows which tables have RLS enabled even if no policies are defined.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| table | No | Filter to a specific table (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only, safe operation. The description adds significant value by detailing that it shows both policies and their expressions, and even tables without policies. This helps the agent predict output and side effects beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured, front-loaded with the main purpose, followed by clear Args and Returns sections, and a helpful note. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description fully details return formats (JSON and Markdown) including fields like PolicyInfo, count, rls_enabled_tables. It also notes edge case behavior (empty policies). This is complete for a read-only listing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema covers 100% of parameters with descriptions. The tool description restates the parameter names and defaults but does not add new semantic meaning beyond the schema. Baseline score is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it lists all RLS policies in a schema, including USING and WITH CHECK expressions. It uses a specific verb ('List') and resource ('RLS policies'), distinguishing it from sibling tools like pg_list_grants or pg_list_indexes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool (to inspect RLS policies), but does not explicitly mention when not to use it or name alternative tools. Since it's the only tool for policies among siblings, usage is implied, but lacks explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_rolesList PostgreSQL Roles and UsersARead-onlyIdempotent
List all PostgreSQL roles with their attributes, privileges, and group memberships.
Returns both login roles (users) and group roles. Shows superuser status, replication, login capability, connection limits, password expiry, and role membership graph.
Args:
login_only: Only show roles that can log in (actual users, not groups) (default: false)
response_format: Output format
Returns: JSON: { roles: RoleInfo[], count: number } Markdown: table with all role attributes + membership info
Useful for access audits, permission reviews, and understanding role hierarchy.
| Name | Required | Description | Default |
|---|---|---|---|
| login_only | No | Only show login roles (users), not group roles | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, destructiveHint, and idempotentHint. The description adds specific behavioral details: it returns both login and group roles, shows attributes like superuser status, replication, and output formats (JSON/Markdown). No contradiction; adds context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with front-loaded purpose, a clear list of args, and no redundant information. Every sentence adds value, and the structure is easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 optional params, no output schema), the description covers the purpose, behavior, output structure, and use cases completely. No gaps remain for an agent to effectively use the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 restates parameters with minor clarifications (e.g., 'actual users, not groups' for login_only) and describes return formats, but adds limited new meaning beyond the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists all PostgreSQL roles with attributes and group memberships, distinguishing it from sibling like pg_list_grants or pg_list_tables. It specifies the exact resource (roles) and action (list), and contrasts with other list tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'Useful for access audits, permission reviews, and understanding role hierarchy,' providing clear context for when to use the tool. It doesn't explicitly state when not to use it, but the sibling list makes alternatives obvious, scoring 4.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_schemasList PostgreSQL SchemasARead-onlyIdempotent
List all user-defined schemas in the current database (excludes pg_catalog, information_schema, pg_toast).
Returns schema name, owner, description, table count, and view count.
Returns: JSON: { schemas: SchemaInfo[], count: number } Markdown: formatted table
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds that it excludes system schemas and returns specific fields, providing useful behavioral context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two focused sentences plus return format description. No redundant information, front-loaded with purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Simple listing tool; description fully covers what it does, returns, and exclusions. No output schema needed since return structure is described. Annotations cover safety.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with parameter description covering format options. Description mentions return formats but does not add new meaning beyond the schema; baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it lists user-defined schemas, excludes system schemas, and returns specific fields (name, owner, description, table/view count). This distinguishes it from sibling tools that list other objects like tables or databases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies use when you need information about user schemas; no explicit alternatives but sibling tools cover different object types, so context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_sequencesList PostgreSQL SequencesARead-only
List all sequences in a schema with their configuration and current state.
Args:
schema: Schema name (default: public)
response_format: Output format
Returns: JSON: { sequences: SequenceInfo[], count: number } Markdown: table with name, type, range, increment, current value, and owning column
Note: last_value reflects the last allocated value, not necessarily the next one to be issued.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds value by detailing the return format (JSON/Markdown with specific columns) and a critical behavioral note: 'last_value reflects the last allocated value, not necessarily the next one to be issued.' This provides clarity beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two clearly separated paragraphs (purposes and return format/note). Every sentence adds value, and the most critical information is front-loaded in the first sentence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple listing tool with no output schema, the description adequately covers the return structure (JSON/Markdown with specific columns) and the important last_value nuance. However, it lacks details on error handling or behavior when the schema does not exist, which would make it more robust.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with both parameters (schema, response_format) fully described in the input schema. The description restates them in the Args section but adds no additional semantics or constraints beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List all sequences in a schema with their configuration and current state.' It uses a specific verb+resource combination and distinguishes the tool from siblings like pg_list_tables or pg_list_indexes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for listing sequences but does not explicitly mention when to use this tool versus alternatives or provide exclusion criteria. The note about last_value is a usage nuance but does not serve as a guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_settingsQuery PostgreSQL Configuration SettingsARead-onlyIdempotent
Search and inspect PostgreSQL runtime settings from pg_settings.
Args:
name_pattern: ILIKE filter on setting name, e.g. "work_mem" or "%memory%" (optional)
category: Filter by category name, e.g. "Memory", "Connections and Authentication", "WAL" (optional)
modified_only: Only show settings that differ from their compiled default (default: false)
response_format: Output format
Returns: JSON: { settings: SettingInfo[], count: number } Markdown: table with name, current value, unit, source, context, description
Common categories: Memory, Connections and Authentication, WAL, Query Tuning, Autovacuum, Logging, Lock Management, Replication, Resource Usage.
Note: 'context' shows where the setting can be changed:
internal: read-only, compiled in
postmaster: requires server restart
sighup: reload only (pg_reload_conf())
user: changeable per-session
| Name | Required | Description | Default |
|---|---|---|---|
| name_pattern | No | ILIKE filter on setting name, e.g. "%mem%" | |
| category | No | Category filter, e.g. "Memory" or "WAL" | |
| modified_only | No | Only show settings changed from default | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds further transparency by explaining the 'context' field and categories, detailing where settings can be changed (internal, postmaster, sighup, user). No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with sections (Args, Returns, Common categories, Note) and front-loaded with the main purpose. It is concise but includes necessary details; no redundant sentences. Minor room for trimming.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description thoroughly covers the tool's inputs, outputs, and behavioral context (context field and common categories). Since there is no output schema, the description compensates well by describing the return format and including useful notes. Slightly more could be added about the use of response_format, but overall complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema coverage is 100% (all parameters described in schema). The description adds value by providing concrete examples for name_pattern and category, and clarifying the meaning of modified_only and response_format. This extra detail justifies a score above the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches and inspects PostgreSQL runtime settings from pg_settings, with a specific verb and resource. It distinguishes from sibling tools by focusing on configuration inspection, which is unique among the list.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly state when to use this tool vs. alternatives. While the purpose is clear, there is no guidance on when not to use it or mention of alternative tools for modifying settings (e.g., pg_execute). The context field explanation is helpful but does not substitute for usage guidelines.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_tablesList Tables in SchemaARead-onlyIdempotent
List all tables (and optionally views) in a PostgreSQL schema with size and row estimates.
Args:
schema: Schema name (default: public)
include_views: Also list views and materialized views (default: false)
response_format: Output format
Returns: JSON: { tables: TableInfo[], count: number, schema: string } Markdown: formatted table with size and row estimates
Note: estimated_rows is approximate (pg_class.reltuples) — use pg_count_rows for exact count.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| include_views | No | Include views and materialized views | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint annotation, the description reveals that row estimates are approximate (from pg_class.reltuples) and that the tool supports two output formats (JSON/Markdown). No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the primary purpose, followed by a structured parameter list, return format description, and a caveat. Every sentence adds value; no extraneous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (3 optional parameters, no output schema), the description thoroughly covers the action, parameter defaults, return structure (both formats), and the approximate nature of estimates. It also suggests an alternative for exact counts, making it complete for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All three parameters have descriptions in the input schema (100% coverage). The description repeats parameters and adds minimal extra meaning (e.g., 'human-readable' for markdown). With high schema coverage, baseline is 3 and the added value is insufficient to raise the score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists tables in a PostgreSQL schema with size and row estimates, optionally including views. This specific verb-resource combination distinguishes it from sibling tools like pg_describe_table (single table), pg_list_views (only views), or pg_count_rows (exact count).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes a note that estimated_rows is approximate and recommends pg_count_rows for exact counts, providing guidance on when to use this tool vs an alternative. However, it does not explicitly exclude other use cases or compare to additional siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_triggersList PostgreSQL TriggersARead-onlyIdempotent
List all triggers in a schema, optionally filtered by table.
Args:
schema: Schema name (default: public)
table: Filter to a specific table (optional)
response_format: Output format
Returns: JSON: { triggers: TriggerInfo[], count: number } Markdown: table with trigger name, table, event, timing, orientation, and statement
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| table | No | Filter to a specific table (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds some value by specifying return formats (JSON/Markdown), but no new behavioral traits beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loaded with the main action, and includes necessary parameter and return details without wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple listing tool with safety annotations, the description adequately covers purpose, parameters, and return format. No output schema, but the return description suffices.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%; the description repeats parameter info without adding new semantics beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists triggers in a schema, optionally filtered by table. This distinguishes it from sibling tools like pg_list_functions or pg_list_tables.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs alternatives. Usage is implied by the tool's purpose (listing triggers), but no when-not-to-use or comparative context is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_typesList Custom PostgreSQL TypesARead-onlyIdempotent
List all user-defined types in a schema: enums, composite types, domains, and range types.
Args:
schema: Schema name (default: public)
type_category: Filter by 'enum', 'composite', 'domain', 'range', or 'all' (default: all)
response_format: Output format
Returns: JSON: { types: TypeInfo[], count: number } Markdown: table with type name, category, enum values (for enums), base type (for domains)
Examples:
Enum "order_status" → values: pending, confirmed, shipped, delivered, cancelled
Domain "positive_int" → base type: integer CHECK (VALUE > 0)
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| type_category | No | Filter by type category | all |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnly, non-destructive, idempotent. Description adds value by explaining return formats (JSON/Markdown) and providing examples of output data, beyond what annotations convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with summary, Args, Returns, Examples. No superfluous text, every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but description compensates with clear return structure and examples. All parameters documented. Complete for a read-only listing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline 3. Description adds meaning with examples (e.g., enum values, base type) and explains how parameters filter results, going beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb 'List' and specific resource 'user-defined types in a schema', enumerating categories (enums, composites, domains, ranges). Distinguishes from sibling tools like pg_list_tables and pg_list_views.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs alternatives. The description implies usage for listing types, but does not specify when not to use or compare with other tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_list_viewsList Views in SchemaARead-onlyIdempotent
List all views and materialized views in a PostgreSQL schema, including their definitions.
Args:
schema: Schema name (default: public)
include_definition: Include the SQL definition of each view (default: false)
response_format: Output format
Returns: JSON: { views: ViewInfo[], count: number, schema: string } Markdown: formatted table
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| include_definition | No | Include SQL view definition | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds details like include_definition option and response_format, which are consistent. No contradictions, but no deeper behavioral insights beyond schema and annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short paragraphs, front-loaded with the main action, no wasted words. Parameter list is compact and return info is clear. Excellent conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple listing tool with full schema coverage and annotations, the description covers everything needed: purpose, parameters, return format. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All parameters are fully described in the input schema (100% coverage). The description reiterates the args and adds return structure (JSON/Markdown), providing value beyond the schema. Baseline 3, but the return description earns a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists views and materialized views in a PostgreSQL schema, using specific verbs and resources. It distinguishes itself from sibling tools like pg_list_tables or pg_list_functions by focusing on views.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs alternatives is provided. The description only states what it does, leaving the agent to infer usage context from the tool name and sibling list. Implied but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_queryExecute Read-Only SQL QueryARead-only
Execute a read-only SQL SELECT query against the PostgreSQL database.
Only SELECT, WITH (CTE), TABLE, and EXPLAIN statements are allowed. Any attempt to execute INSERT, UPDATE, DELETE, DDL, or other mutating statements will be rejected.
Args:
sql: The SQL SELECT statement to execute (required)
limit: Maximum rows to return, 1-1000 (default: 100)
timeout_ms: Query timeout in milliseconds (default: 30000)
response_format: Output format
Returns: JSON: { rows: object[], row_count: number, column_names: string[] } Markdown: formatted table of results
Examples:
"SELECT * FROM users WHERE active = true" → rows with limit applied
"WITH stats AS (SELECT ...) SELECT * FROM stats" → CTE supported
"EXPLAIN SELECT * FROM orders" → query plan
Errors:
"Only read-only queries allowed" if non-SELECT statement attempted
PostgreSQL syntax/permission errors returned as-is
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SELECT SQL statement to execute | |
| limit | No | Maximum rows to return (default: 100, max: 1000) | |
| timeout_ms | No | Query timeout in milliseconds (default: 30000) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint=true. Description adds concrete constraints: allowed statements, limit bounds (1-1000), timeout (1000-300000), response formats, and error handling for disallowed queries. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is well-organized with clear sections (Args, Returns, Examples, Errors). Every sentence adds value. Front-loaded with main action. Concise and to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking output schema, the description comprehensively covers parameter details, allowed operations, return format, and error conditions. No missing information 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.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (baseline 3). Description adds value by reinforcing allowed SQL types, providing default values, adding examples, and clarifying error cases. Exceeds minimum.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Title and description clearly state the tool executes read-only SQL SELECT queries. Lists allowed statement types (SELECT, WITH, TABLE, EXPLAIN) and explicitly excludes mutating statements. Distinguishes from siblings like pg_execute and pg_explain.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (read-only queries) and what statements are allowed. Implicitly guides not to use for writes. Could explicitly mention pg_execute as alternative for mutating queries, but context with siblings makes it clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_replication_statusShow Replication StatusARead-only
Show the status of all streaming replication standbys connected to this primary, including replay lag.
Only meaningful on a primary server with active streaming replication.
Returns: JSON: { replicas: ReplicaInfo[], is_standby: boolean, lsn: string } Markdown: replica table with address, state, lag size, sync state
Useful for monitoring replication health and identifying lagging standbys.
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, destructiveHint=false. The description adds behavioral context beyond annotations, such as the return format (JSON/Markdown) and specific data fields (replicas, is_standby, lsn). No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loaded with the main purpose, and structured into clear sections. Every sentence serves a purpose, though the 'Returns' section could be integrated more succinctly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple parameter set (1 optional param, 100% schema coverage) and no output schema, the description adequately explains the return format and use case. It covers core aspects without major gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description adds modest value by explaining the return format differences. It does not elaborate further on the parameter's effect or constraints beyond what the schema already provides, resulting in a baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it shows the status of all streaming replication standbys with replay lag. It distinguishes itself from sibling tools (e.g., pg_active_queries, pg_connection_stats) by focusing specifically on replication health.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly notes 'Only meaningful on a primary server with active streaming replication,' providing clear context. While it doesn't specify when not to use it, the condition is sufficient for a monitoring tool with no direct alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_sample_rowsGet Sample Rows from TableARead-only
Retrieve a sample of rows from a PostgreSQL table, with optional filtering and column selection.
Args:
table: Table name (required)
schema: Schema name (default: public)
limit: Number of rows to return, 1-500 (default: 10)
where_clause: Optional WHERE clause (without the WHERE keyword), e.g. "status = 'active'"
columns: Comma-separated column names to select (optional, default: all columns)
order_by: ORDER BY clause (without ORDER BY), e.g. "created_at DESC"
response_format: Output format
Returns: JSON: { table, schema, row_count, columns: string[], rows: object[] } Markdown: formatted table of results
Security: table and schema names are validated against actual database objects before use.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to sample | |
| schema | No | PostgreSQL schema name (default: public) | public |
| limit | No | Number of rows (default: 10, max: 500) | |
| where_clause | No | Optional WHERE condition without 'WHERE', e.g. "age > 18 AND active = true" | |
| columns | No | Comma-separated column names to return (default: all, e.g. 'id, name, email') | |
| order_by | No | ORDER BY clause without 'ORDER BY', e.g. 'created_at DESC' | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No contradiction with annotations (readOnlyHint=true, destructiveHint=false). The description adds context about security validation of table/schema names and specifies return formats (JSON and Markdown), which goes beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear main purpose and bullet-like arg list. It is somewhat verbose but effective. The main purpose is front-loaded, making it easy for an AI to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 7 parameters, 100% schema coverage, no output schema, and existing annotations, the description covers purpose, parameter nuances, return formats, and security notes. Minor missing details about sampling algorithm and performance, but overall complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, baseline is 3. The description adds value by clarifying syntax for where_clause and order_by (omit keywords) and explaining response_format options, which enriches parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Retrieve a sample of rows from a PostgreSQL table' with optional filtering and column selection. This specific verb-resource combination distinguishes it from sibling tools like pg_count_rows (counts only) and pg_execute (custom SQL).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for quick sampling with optional filters, but does not explicitly state when to use this tool versus siblings like pg_query or pg_count_rows. No exclusion criteria or alternative recommendations are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_search_objectsSearch Database Objects by NameARead-onlyIdempotent
Search across all database objects (tables, views, functions, indexes, sequences, constraints) by name pattern.
Args:
pattern: Case-insensitive name pattern, supports SQL LIKE wildcards: % (any chars), _ (one char) (required)
object_types: Filter by object type — 'table', 'view', 'function', 'index', 'sequence', 'constraint', 'trigger' (optional, searches all types by default)
schema: Limit search to a specific schema (optional)
response_format: Output format
Returns: JSON: { matches: SearchResult[], count: number } Markdown: grouped results by type
Examples:
pattern: "user%" → all objects starting with "user"
pattern: "%order%" → all objects containing "order"
pattern: "idx_%" with object_types: ["index"] → all indexes
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | LIKE pattern, e.g. "user%" or "%order%" | |
| object_types | No | Object types to search (optional, searches all types by default) | |
| schema | No | Limit to a specific schema (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, destructiveHint, and idempotentHint. The description adds useful behavioral context: return format (JSON or Markdown), grouping by type, and example patterns. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args, Returns, and Examples sections. It is concise yet comprehensive, with every sentence adding value. Front-loaded with the main purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the moderate complexity (4 parameters, no output schema), the description is complete. It covers all parameters, return format, and usage examples. No gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 adds value by explaining LIKE wildcards, providing examples for each parameter, and clarifying the default behavior for optional parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies a clear verb ('search'), resource ('database objects'), and scope ('by name pattern'). It explicitly lists object types and distinguishes from sibling list tools by offering combined search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use the tool with examples and context. It does not explicitly state when not to use it or contrast with siblings, but the usage is clear from the purpose and examples.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_server_infoGet PostgreSQL Server InformationARead-onlyIdempotent
Get detailed PostgreSQL server information: version, connection details, memory settings, WAL configuration, and runtime parameters.
Returns: JSON: { version, current_database, current_user, settings: {...}, uptime } Markdown: formatted multi-section report
Useful for understanding the server environment, verifying connection details, and checking key configuration values.
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, indicating a safe read operation. The description adds value by detailing the return structure (version, current_database, current_user, settings, uptime) and format options (JSON or Markdown), going beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, efficiently structured: first sentence states purpose, second lists return types, third gives use case context. No wasteful words, front-loaded with key information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has low complexity (one optional parameter), rich annotations, and no output schema, the description adequately covers what the tool returns, output format options, and use cases. It is complete for an informational tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with one parameter (response_format) fully described via enum and default. The description mentions output formats but does not add significant meaning beyond the schema, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves detailed PostgreSQL server information including version, connection details, memory settings, WAL configuration, and runtime parameters. This specific verb+resource combination distinguishes it from siblings like pg_list_settings (which lists individual settings) and pg_connection_stats (focused on connection statistics).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear usage context: 'Useful for understanding the server environment, verifying connection details, and checking key configuration values.' However, it does not explicitly state when not to use this tool or suggest alternatives, which would strengthen the guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_slow_queriesShow Slow Queries from pg_stat_statementsARead-only
Analyze slow queries using the pg_stat_statements extension. Shows queries ranked by mean execution time.
Requires the pg_stat_statements extension to be installed and enabled.
Args:
limit: Number of queries to return (default: 20, max: 100)
min_calls: Only show queries called at least N times (default: 5)
order_by: Sort by 'mean_ms', 'total_ms', or 'calls' (default: mean_ms)
response_format: Output format
Returns: JSON: { queries: SlowQuery[], count: number } Markdown: table with calls, mean/total time, % of total, cache hit %, query text
Errors:
"pg_stat_statements extension not installed" if extension is missing
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of queries to return | |
| min_calls | No | Minimum number of calls to include | |
| order_by | No | Sort order | mean_ms |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true, so the description adds value by stating the extension requirement, the output formats (JSON and Markdown with fields), and error conditions. This provides useful behavioral context beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with separate sections for arguments, returns, and errors. The first sentence immediately conveys the tool's purpose, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all essential aspects: purpose, prerequisites, parameter details, return formats with field descriptions, and error handling. It is complete for the given schema and no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the baseline is 3. The description repeats parameter defaults and options but does not add new meaning beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: analyzing slow queries using pg_stat_statements and ranking by mean execution time. It distinguishes from sibling tools like pg_active_queries and pg_query by focusing specifically on slow queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions the prerequisite (pg_stat_statements extension) and provides default values for parameters, but does not explicitly guide when to use this tool versus alternatives, nor does it specify when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_table_statsGet Table StatisticsARead-onlyIdempotent
Get detailed statistics for tables: size, live/dead rows, vacuum/analyze info, scan counts.
Useful for identifying bloated tables, missing vacuums, or underused indexes.
Args:
schema: Filter to a specific schema (optional, shows all user schemas if omitted)
table: Filter to a specific table name (optional)
response_format: Output format
Returns: JSON: { stats: TableStats[], count: number } Markdown: formatted table with size, rows, vacuum dates, scan counts
Note: Requires pg_stat_user_tables access. Row counts are from pg_stat_user_tables (updated by autovacuum/analyze) — use pg_count_rows for exact counts.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Filter to specific schema (optional) | |
| table | No | Filter to specific table (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, destructiveHint, and idempotentHint. The description adds value by noting that the tool requires pg_stat_user_tables access and explaining that row counts come from autovacuum/analyze statistics rather than exact counts. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args and Returns sections, but it is slightly verbose by repeating some schema details. It could be more concise while retaining all essential information. Still, it is clear and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, but the description details the return format (JSON or Markdown) and key fields. Important notes about row count accuracy and required privileges are included. For a read-only tool with three optional parameters, this is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and each parameter has a description. The description adds minor context (shows all user schemas if omitted) but does not significantly enhance beyond the schema. Baseline 3 is appropriate as the schema already carries the burden.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves detailed table statistics (size, rows, vacuum/analyze info, scan counts). It distinguishes itself from sibling tools like pg_count_rows (exact counts) and pg_bloat_report (bloat-specific), making its unique purpose evident.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lists use cases: identifying bloated tables, missing vacuums, or underused indexes. It also advises when to use an alternative (pg_count_rows for exact counts), providing clear guidance on when to use this tool vs. others.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_transactionExecute Multiple Statements in a TransactionADestructive
Execute multiple SQL statements atomically in a single transaction.
All statements succeed or all are rolled back. Ideal for multi-step operations that must be atomic (e.g., insert + update, schema migrations).
Args:
statements: Array of SQL statements to execute in order (required)
confirm_destructive: Required if any statement is DROP/TRUNCATE/DELETE-without-WHERE
Returns: JSON: { results: [{command, rows_affected}], total_duration_ms, rolled_back: false } On error: { error, rolled_back: true, failed_at_index: number }
Examples: statements: ["INSERT INTO orders ...", "UPDATE inventory SET qty = qty - 1 WHERE ..."]
| Name | Required | Description | Default |
|---|---|---|---|
| statements | Yes | SQL statements to execute in order within a transaction | |
| confirm_destructive | No | Set true if any statement is destructive (DROP/TRUNCATE/DELETE without WHERE) | |
| timeout_ms | No | Per-statement timeout in milliseconds |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description details atomic rollback behavior, confirms destructive hint from annotations, explains error response with rolled_back and failed_at_index, adding significant context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is concise with clear sections: purpose, behavior, parameters, return format, and example. All sentences are essential without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all key aspects: atomicity, parameters, return format, error handling, and destructive confirmation. Appropriate for a transaction tool with no missing information despite lack of output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but description adds value by explaining statements as required array, clarifying confirm_destructive as mandatory for destructive operations, and providing usage examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description explicitly states 'Execute multiple SQL statements atomically in a single transaction' with a specific verb and resource, clearly distinguishing it from siblings like pg_execute which executes individual statements without transaction guarantees.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description indicates ideal use for atomic multi-step operations and provides examples, but does not explicitly state when not to use or contrast with non-transactional execution alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pg_vacuumRun VACUUM on a TableAIdempotent
Execute VACUUM, VACUUM ANALYZE, or VACUUM FULL on a table to reclaim dead-tuple storage.
Modes:
standard: Reclaims dead-tuple space for reuse within the table (non-blocking)
analyze: VACUUM + updates query planner statistics (recommended for most cases)
full: Rewrites the table to reclaim disk space to OS — requires exclusive lock, very slow on large tables
Args:
table: Table name (required)
schema: Schema name (default: public)
mode: 'standard', 'analyze', or 'full' (default: analyze)
confirm_full: Required when mode is 'full' — acknowledges table will be locked
Returns: Duration and confirmation of completion.
Warning: VACUUM FULL acquires an exclusive lock — all queries on the table will block until it completes. Use during maintenance windows only.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table to vacuum | |
| schema | No | Schema name (default: public) | public |
| mode | No | 'standard', 'analyze', or 'full' | analyze |
| confirm_full | No | Required when mode=full — confirms exclusive lock accepted |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond annotations (e.g., idempotentHint: true), the description adds critical behavioral details: VACUUM FULL acquires exclusive locks and blocks queries, the return value includes duration and confirmation, and it recommends analyze for most cases. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with clear sections (modes, args, returns, warning). Each sentence is purposeful, no fluff. It is concise yet thorough, perfectly balancing detail and brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (locking, blocking, multiple modes), the description covers prerequisites (confirm_full), behavioral nuances (non-blocking vs. blocking), return format, and performance warnings. Annotations handle idempotency and destructive nature, so no gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the description still adds value by explaining default values (schema=public, mode=analyze), requiring confirm_full for 'full' mode, and clarifying the effect of each mode on table locking and statistics. This provides actionable semantics beyond the schema's property descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool executes VACUUM operations on a table to reclaim storage, and distinguishes three modes. It stands out from sibling tools (e.g., pg_bloat_report, pg_count_rows) by focusing on maintenance operations rather than inspection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides excellent guidance on when to use each mode (standard, analyze, full) and warns that VACUUM FULL requires maintenance windows due to exclusive locks. However, it does not explicitly contrast with alternative sibling tools for similar tasks, such as when to use pg_bloat_report instead.
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.
36 tool updates
v1.0.0- First observed
pg_active_queries - First observed
pg_bloat_report - First observed
pg_connection_stats - First observed
pg_copy_csv - First observed
pg_count_rows - First observed
pg_describe_table - First observed
pg_execute - First observed
pg_explain - First observed
pg_get_ddl - First observed
pg_index_usage - First observed
pg_kill_query - First observed
pg_list_databases - First observed
pg_list_extensions - First observed
pg_list_functions - First observed
pg_list_grants - First observed
pg_list_indexes - First observed
pg_list_locks - First observed
pg_list_partitions - First observed
pg_list_policies - First observed
pg_list_roles - First observed
pg_list_schemas - First observed
pg_list_sequences - First observed
pg_list_settings - First observed
pg_list_tables - First observed
pg_list_triggers - First observed
pg_list_types - First observed
pg_list_views - First observed
pg_query - First observed
pg_replication_status - First observed
pg_sample_rows - First observed
pg_search_objects - First observed
pg_server_info - First observed
pg_slow_queries - First observed
pg_table_stats - First observed
pg_transaction - First observed
pg_vacuum
TDQS
Most tools have distinct purposes, but there is some overlap between pg_bloat_report and pg_table_stats, and between several list* tools. However, descriptions are clear enough to disambiguate.
All tools use the 'pg_' prefix and follow a consistent snake_case pattern, with most using verb_noun or noun_noun, which is predictable and clear.
36 tools is high, but each serves a specific purpose in database management, from querying to schema inspection and performance monitoring. The count is slightly over typical but well-scoped for the domain.
The tool set covers the full lifecycle of database interaction: read/write queries, schema exploration, performance analysis, maintenance tasks, and transaction management. No obvious gaps for a general-purpose PostgreSQL server.
Maintenance
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
Hosted MCP server for PostgreSQL diagnostics: slow queries, missing indexes, connection pressure.
- dataOAuthco.thinair
Read-only PostgreSQL, MySQL, SQL Server access via MCP — 24 dialect-aware hosted tools.
- SupabaseOAuthcom.supabase
MCP server for interacting with the Supabase platform
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables secure querying of PostgreSQL databases through MCP-compatible clients. Supports read-only SQL execution, table exploration, and connection management with built-in security validation.3419MIT
- AlicenseAqualityAmaintenanceMCP server with 14 tools for PostgreSQL database operations. Query databases, explore schemas, analyze tables, with SQL injection prevention and read-only mode by default.1410MIT
- AlicenseAqualityCmaintenanceA Python-based MCP server for interactive PostgreSQL data exploration, schema discovery, and safe SQL execution with support for stored procedures. It also enables automation through external HTTP API requests and local bash script execution on Fedora and Linux systems.19MIT
- AlicenseAqualityCmaintenanceProvides PostgreSQL database management and analysis via MCP, enabling schema exploration, query execution, performance monitoring, and database health checks.3623MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/foxter-io/mcp-postgresql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server