Skip to main content
Glama
mcp-server-postgres

mcp-server-postgres

by Ismail-2001

query

Executes validated, parameterized PostgreSQL SQL with read-only/read-write tiers and paginated results.

Instructions

Executes a validated PostgreSQL query with parameterized inputs (Tier: READ_ONLY/READ_WRITE).

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": {
      "sql": "<sql>"
    },
    "name": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe SQL query to execute.
pageNo
paramsNoParameterized values ($1, $2, etc.).
page_sizeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.4/5.0
Behavior2/5

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

With no annotations, the description carries the full disclosure burden. It says the query is "validated" and that inputs are parameterized, but never states what validation permits or rejects, whether writes are actually allowed, whether multi-statement SQL is accepted, or what permissions are required. The READ_ONLY/READ_WRITE tier note hints at a safety model without resolving it.

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

Conciseness4/5

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

A single compact sentence with the operation front-loaded and no filler. It is efficient, though its brevity is partly the cause of the gaps flagged elsewhere rather than pure economy.

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

Completeness2/5

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

For a 4-parameter SQL execution tool with no annotations and no output schema, the description is too thin: pagination behavior, validation semantics, and the read/write capability question all go unanswered. The tier parenthetical raises a critical question about mutation safety without answering it.

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

Parameters2/5

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

Schema description coverage is 50%: sql and params are documented in the schema, while page and page_size have no description in either place. The description only echoes "parameterized inputs" already covered by the params field and adds no meaning for the undocumented pagination parameters.

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

Purpose3/5

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

The description names a specific verb and resource ("Executes a ... PostgreSQL query"), so the basic operation is clear. However, it does not distinguish this from siblings like nl_query, explain, or transaction, and the parenthetical "Tier: READ_ONLY/READ_WRITE" is ambiguous — it reads as if the tool could be either, which muddies rather than sharpens its purpose.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance and no alternative tool is named, even though the sibling set contains several query-adjacent tools (nl_query, explain, transaction). An agent must infer entirely on its own when raw SQL execution is the right choice.

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