Skip to main content
Glama
mcp-server-postgres

mcp-server-postgres

by Ismail-2001

nl_query

Converts natural-language requests into validated SQL and executes it against PostgreSQL, enabling schema-aware database queries through secure guardrails.

Instructions

Intelligently translates natural language into validated, optimized SQL and executes 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": {
      "request": "<request>"
    },
    "name": "nl_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextNo
requestYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it only says the generated SQL is 'validated, optimized' and then executed. It never discloses whether the executed SQL may write or drop data, what permissions are required, whether dialect/schema scoping applies, or what happens when validation fails — all critical for a tool that runs generated SQL.

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 front-loaded sentence that states the input form and the two-step behavior with no structural waste. The only expendable word is the marketing adverb 'Intelligently', which does not earn its place.

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 two-parameter tool with an undocumented nested object, no output schema, and no annotations, one sentence is far too thin. An agent cannot tell what `context` should contain, what the response looks like, or whether invoking this risks mutating the database.

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 0%, so the description must compensate for both parameters and does not. Only the `request` parameter is indirectly characterized as natural language; the nested `context` object — the parameter most likely to need explanation — is not mentioned at all, leaving its structure and purpose entirely opaque.

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 transformation (natural language -> validated, optimized SQL) and states that it also executes the result, which separates it from a pure `explain` sibling. It never names a sibling explicitly, and the adverb 'Intelligently' adds no discriminating information, so it stops short of a 5.

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?

Use is only implied: an agent can infer it should call this when it has a natural-language question rather than hand-written SQL. There is no explicit when-not guidance, no mention of `query` or `explain` as alternatives, and no statement about whether this tool is safe to call without confirmation.

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