Skip to main content
Glama
multi-postgres-mcp-server

multi-postgres-mcp-server

by VKirill

pg_query

Execute SQL queries against a PostgreSQL database, returning results with optional parameters and row limits; read-only by default with writes allowed only on configured non-read-only connections.

Instructions

Execute a SQL query against a PostgreSQL database. Read-only by default; write queries allowed only if the connection is configured with readOnly: false.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>",
      "query": "<query>"
    },
    "name": "pg_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax rows to return (truncates results if exceeded)
queryYesSQL query to execute
paramsNoOptional query parameters for $1, $2, ... placeholders
databaseYesDatabase label from config

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the full behavioral burden; it does disclose the key safety property (read-only by default, writes gated on connection config), which is genuinely useful. It omits other traits an agent needs: whether multiple statements are permitted, transaction/commit semantics, error behavior, and what happens to a write attempt when the connection is read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with no waste, and the safety constraint is front-loaded immediately after the purpose statement. Every sentence earns its place.

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

Completeness4/5

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

For a four-parameter tool with full schema coverage and no output schema, the description covers purpose and the critical write-gating behavior. The main residual gap is return-shape information (rows, truncation semantics), which the absence of an output schema leaves partially unaddressed.

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

Parameters3/5

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

Schema description coverage is 100%, so query, params, database, and limit are already documented in the schema, and the description adds no parameter-level detail. Baseline 3 applies when the schema does the heavy lifting.

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

Purpose4/5

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

The description states a specific verb and resource: execute a SQL query against a PostgreSQL database. It is clearly distinct in spirit from the pg_list_* / pg_describe_table / pg_health_check siblings, though it never explicitly says how it differs from pg_explain, which is the nearest conceptual neighbor.

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

Usage Guidelines3/5

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

The read-only-by-default rule and the condition for allowing writes (connection configured with readOnly: false) give real usage context, but there is no explicit when-to-use-this-vs-alternatives guidance, notably nothing routing the agent to pg_explain for query plans or pg_describe_table for schema introspection.

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