Skip to main content
Glama
bysonte

postgres-mcp-server

by bysonte

execute_query

Execute read-only SQL queries (SELECT, WITH, EXPLAIN, SHOW) on PostgreSQL. Queries run inside a READ ONLY transaction to prevent accidental writes.

Instructions

Ejecuta una consulta SQL de solo lectura. Por seguridad corre dentro de una transacción READ ONLY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesConsulta SELECT/WITH/EXPLAIN/SHOW
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the query is executed inside a READ ONLY transaction for security, which clarifies that the tool cannot modify data. This is a key safety trait beyond what the schema shows. However, it doesn't mention return format, error handling, or limits, leaving some behavioral aspects 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?

The description is two concise, front-loaded sentences that state the purpose and then a critical safety detail. There is no fluff or redundant information, making it an efficient and well-structured description.

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 tool is simple with one well-documented parameter, and the description covers purpose and safety effectively. However, there is no output schema, and the description does not mention the return format or contents of the result, which is a notable gap for a query execution tool. The READ ONLY transaction context helps, but the lack of return value disclosure makes the description incomplete for an agent deciding whether to use it.

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?

The schema provides 100% coverage with a description for the 'sql' parameter specifying 'Consulta SELECT/WITH/EXPLAIN/SHOW'. The tool description's 'solo lectura' aligns with the schema but adds no additional parameter-level detail. Since the schema already documents the parameter thoroughly, the baseline of 3 is appropriate.

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 clearly states 'Ejecuta una consulta SQL de solo lectura' (executes a read-only SQL query), using a specific verb and resource with a clear safety scope. This distinguishes it from siblings like execute_dml_ddl_dcl_tcl, which handle write/modification operations. The schema description reinforces the allowed query types (SELECT/WITH/EXPLAIN/SHOW).

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 explicitly states the tool is for read-only SQL and runs in a READ ONLY transaction, clearly indicating when it should be used. Though it doesn't explicitly name alternative tools for write operations, the read-only constraint is unambiguous and pairs well with sibling names. No explicit exclusions are given, but the context is strong.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bysonte/postgres-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server