Skip to main content
Glama
nayzo

mcp-postgresdb-readonly

by nayzo

query

Execute read-only SQL SELECT statements against PostgreSQL staging, test, or prod databases to retrieve data safely without write operations.

Instructions

Execute a read-only SQL query on a PostgreSQL database.

⛔ WRITE OPERATIONS ARE STRICTLY FORBIDDEN (INSERT, UPDATE, DELETE, DROP, etc.)

  • Always use schema-qualified table names (e.g., schema.table_name)

  • Only SELECT queries are accepted

  • Use parameterized queries for user-provided values

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envYesTarget environment (staging, test, prod)
sqlYesSQL SELECT query to execute (read-only)
paramsNoOptional parameters for parameterized queries

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4.3/5.0
Behavior5/5

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

No annotations are provided, so the description carries full burden and does so well: it discloses the read-only contract emphatically, warns that write ops are forbidden, and prescribes schema-qualified names. This is exactly the behavioral context an agent needs before touching a production database.

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?

Front-loaded with purpose, then constraints in a compact bullet list. The ⛔ emoji is a bit heavy-handed but the substance all earns its place. Minor redundancy between the top-line 'read-only' and the bullet re-stating SELECT-only.

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 3-param query tool with no output schema and no annotations, the description covers the essential safety contract and rules. It could say more about result shape or limits (row caps, timeouts), but the core agent needs are addressed.

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 env, sql, and params are already documented in the schema. The description adds the parameterized-query convention ('use parameterized queries for user-provided values'), which connects the params array to the sql placeholder pattern – useful but minimal beyond what the schema states.

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

Purpose5/5

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

States a specific verb (execute) and resource (read-only SQL query on PostgreSQL) in the first sentence. The tool is cleanly distinguished from siblings like list-tables and describe-table, which are metadata tools, while this one runs actual queries.

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

Usage Guidelines4/5

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

Gives clear constraints on when this tool applies – only SELECT queries, read-only. The constraint list effectively excludes write operations. However, it doesn't explicitly say when to reach for this vs. describe-table/list-tables for schema exploration, leaving some ambiguity about discovery vs. query workflows.

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