Skip to main content
Glama
raphaeljordao86

guarded-postgres-mcp

query

Read-onlyIdempotent

Run one SELECT, WITH, or EXPLAIN inside a read-only transaction that always rolls back, returning up to 1000 rows for safe database investigation.

Instructions

Runs ONE SELECT/WITH/EXPLAIN inside a READ ONLY transaction that is always rolled back. Statements that modify data are rejected. Returns at most GUARD_QUERY_MAX_ROWS rows (default 1000) and says when the result was cut. Use it for investigation and analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesOne SELECT, WITH or EXPLAIN statement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.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 readOnly/idempotent/non-destructive, but the description adds genuinely useful context: the transaction is always rolled back, modifications are rejected, and results are capped at GUARD_QUERY_MAX_ROWS (default 1000) with explicit truncation signaling. That row-limit and rollback behavior goes well beyond what annotations convey.

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?

Three tight sentences, zero filler, with the critical read-only constraint and single-statement limit front-loaded. Every sentence carries distinct information (mode, rejection rule, row cap, intended use).

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?

With no output schema, the description appropriately explains the return behavior (up to N rows, truncation noted). Combined with the safety annotations and full schema coverage, an agent has enough to invoke correctly; only sibling differentiation is left implicit.

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 coverage is 100% for the single `sql` parameter, so the schema already documents it as "One SELECT, WITH or EXPLAIN statement." The description's "ONE" emphasis adds a mild constraint (single statement only) but nothing beyond syntax/format detail, so baseline 3 applies.

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?

States a specific action (runs one SELECT/WITH/EXPLAIN) and resource (read-only query) with a clear scope constraint. It is distinguishable from the write-oriented siblings execute/execute_transaction by its read-only framing, but it never names those siblings, so the contrast is inferred rather than stated.

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 it for investigation and analysis" gives a usage context, and the rejection of data-modifying statements implies a when-not boundary. However, it never references the alternatives (execute, execute_transaction) that an agent must choose between, leaving the routing decision implicit.

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