Skip to main content
Glama
johannschiffer

PgSafe MCP

safe_query

Execute read-only SQL SELECT/EXPLAIN queries with automatic LIMIT enforcement and mutation blocking to prevent accidental data changes.

Instructions

Execute a strictly read-only SQL query with automatic LIMIT enforcement and mutation blocking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum rows to return (default: 100, max: 1000)
queryYesSQL query to execute (must be SELECT/EXPLAIN)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/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 disclose key behavior: read-only enforcement, automatic LIMIT injection, and mutation blocking. It stops short of covering error behavior, result truncation, or permission requirements, but the safety profile is unusually well communicated for an unannotated tool.

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?

A single front-loaded sentence with zero filler. The scope constraint and the two enforcement behaviors are packed in without redundancy.

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?

No output schema exists, yet the description adequately frames what the tool returns conceptually (rows, capped by LIMIT). It omits result-format, error, and truncation details, but with both parameters fully documented in the schema and the safety semantics stated, it is close to complete for a two-parameter read tool.

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 both the limit (default 100, max 1000) and query (SELECT/EXPLAIN) parameters are already fully documented in the schema. The description adds no syntax, format, or edge-case detail beyond what the schema states, so the 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 verb (Execute) and resource (SQL query) with a clear scope qualifier (strictly read-only). It does not explicitly distinguish itself from the sibling analyze_query, so an agent must infer the execute-vs-analyze split rather than being told.

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?

The phrase 'strictly read-only' and 'must be SELECT/EXPLAIN' implicitly define the acceptable usage context, but the description never says when to pick this over analyze_query or describe_table, nor what to do when a query is rejected. Usage is implied rather than stated.

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