Skip to main content
Glama
Snarloff

pg-multi-mcp

by Snarloff

execute_sql

Destructive

Runs SQL on a selected PostgreSQL connection, enforcing read-only validation for restricted mode and allowing DML/DDL on unrestricted connections.

Instructions

Execute SQL on the chosen connection. Connections in 'restricted' mode only accept read-only SQL (validated, READ ONLY transaction, timeout); 'unrestricted' connections accept any SQL (DML/DDL).

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL to run
max_rowsNoMáximo de linhas retornadas (o excedente é truncado)
connectionNoNome ou alias da conexão (veja list_connections). Se omitido, usa a conexão ativa ou a padrão.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations supply only destructiveHint=true, and the description adds real substance beyond that: mode-dependent acceptance of DML/DDL, validation plus a READ ONLY transaction for restricted mode, and a timeout. It still doesn't say what happens with multiple statements, what an error response looks like, or that results beyond max_rows are silently truncated.

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?

Two sentences, zero filler, with the core action front-loaded before the mode-dependent constraint. Every clause carries information the agent needs.

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 an output schema present and the return shape covered there, the description only needs to convey execution semantics, which it does for the read-only/write split. It leaves gaps around statement count limits, error behavior, and truncation semantics for a tool whose annotation profile is a single destructiveHint.

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 100%, so the baseline is 3, and the description earns a bump by explaining what the 'connection' parameter actually implies — the connection's restricted/unrestricted mode determines whether the SQL is accepted. It adds nothing about 'sql' or 'max_rows' beyond the schema text.

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 first sentence states a specific verb and resource ('Execute SQL on the chosen connection'), which clearly separates it from execute_mongo and the connection-management siblings. It stops short of naming the nearest alternative (explain_query) or stating that this is the tool for actually running statements rather than inspecting plans.

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 description gives conditional context — read-only SQL only on 'restricted' connections, any SQL on 'unrestricted' ones — which implies when a call will succeed. However, it never routes the agent to alternatives (explain_query for plans, list_connections to find a connection, execute_mongo for Mongo) or states prerequisites for picking a connection.

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