Skip to main content
Glama

Postgres Query Readonly

postgres_query_readonly

Execute parameterized SELECT queries on Postgres; DDL/DML and multi-statement SQL are rejected before any connection opens.

Instructions

Run a parameterized SELECT against Postgres (DDL/DML rejected first).

Requires OPS_MCP_DATABASE_URL. Multi-statement and write SQL fail closed before any connection is opened.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo
max_rowsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so very well. It discloses the required environment variable, the fail-closed behavior, the rejection of DDL/DML and multi-statement SQL, and that this all happens before any connection is opened.

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?

The description is short and front-loaded, with the core action in the first line. There is minor redundancy between 'DDL/DML rejected first' and 'write SQL fail closed', but overall every sentence contributes useful safety or setup information.

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?

The behavioral and safety aspects are well covered, and an output schema exists for return values. However, the tool has three parameters and zero schema descriptions, so the missing param semantics and row-limit behavior leave the definition merely adequate rather than complete.

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 undocumented parameters. It only hints at parameterization without explaining the expected placeholder syntax, the shape of params, or the meaning of max_rows. This is a meaningful gap for an agent trying to call the tool correctly.

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?

The description names a specific verb and resource: 'Run a parameterized SELECT against Postgres', and explicitly states that DDL/DML are rejected. This clearly separates it from write tools and from the sibling postgres_explain, which is for EXPLAIN output rather than general read-only querying.

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?

The description makes it clear this tool is for read-only SELECT queries and explicitly rejects DDL/DML, multi-statement, and write SQL. It does not name an alternative tool such as postgres_explain, so it misses the explicit 'use this when, use that when' comparison, but the boundaries are otherwise clear.

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