Skip to main content
Glama
Postgres MCP Server

Postgres MCP Server

by Zotriq

ask

Answers plain-English questions by generating safe SQL from your live PostgreSQL schema and optionally running validated, read-only queries with row limits.

Instructions

Answer a plain-English question: writes safe SQL from the live schema and (optionally) runs it.

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": {
      "question": "<question>"
    },
    "name": "ask"
  }
}

Input Schema

NameRequiredDescriptionDefault
runNo
databaseNo
questionYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two useful traits: SQL is generated from the live schema and execution is optional. It does not say whether the generated SQL is restricted to reads (is 'safe' read-only or merely syntactically valid?), nor what run=false returns, leaving the mutation profile ambiguous.

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 tight sentence with the core action front-loaded and no filler. Minor ambiguity in 'writes safe SQL' (writes SQL vs. writes to a database) slightly undercuts it.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, but for a tool that can execute generated SQL the missing read-only guarantee and the undefined database parameter are real gaps an agent would want covered.

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 0% across 3 parameters, so the description must compensate. It clarifies 'question' (plain English) and effectively explains 'run' via '(optionally) runs it', but the 'database' parameter is never mentioned, so one of three parameters remains undefined in both schema and description.

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 names a specific verb chain and resource: it converts a plain-English question into SQL against the live schema and optionally executes it. That is materially different from run_query (which takes SQL) and explain_query, so an agent can place it, though the description never names those siblings explicitly.

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?

Usage is implied rather than stated: 'plain-English question' signals the natural-language entry point and 'optionally runs it' hints at a preview-then-execute workflow. There is no explicit when-to-use/when-not guidance and no pointer to run_query for already-written SQL.

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