Skip to main content
Glama
hellorutvik

pg-readonly-mcp

by hellorutvik

query

Read-onlyIdempotent

Run read-only SQL statements against PostgreSQL to answer data questions without changing records. Row caps and column masking help protect sensitive data.

Instructions

Run one read-only SQL statement (SELECT / WITH / TABLE / VALUES / EXPLAIN).

Input Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds context annotations do not carry: only a single statement is accepted, and the statement must be one of SELECT/WITH/TABLE/VALUES/EXPLAIN. Row limits, timeouts, and failure behavior remain undisclosed.

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

Conciseness5/5

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

One sentence, front-loaded with the verb and the key constraint, with no filler or redundancy.

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?

There is no output schema, and the description never indicates the shape of results (rows, column names, error reporting), which matters for a general SQL execution tool. The allowed-statement constraint is covered, but an agent still cannot anticipate the return payload.

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

Parameters4/5

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

Schema coverage is 0% (the only parameter is a bare 'Sql' string with no description), so the description must compensate. It does so by defining what belongs in that parameter: a single read-only statement of one of the listed forms.

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 action and resource: execute a single read-only SQL statement, with the permitted statement forms enumerated. It is clearly distinguishable in practice from list_tables and describe_table, though it 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?

'Run one read-only SQL statement' implies when to use it, and the enumerated statement types set a boundary. However, there is no explicit guidance on when to prefer list_tables or describe_table for schema exploration versus issuing ad-hoc SQL.

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

Deploy Server

Other Tools