Skip to main content
Glama
andre-c-andersen

pg-mcp

execute_sql

Run read-only SQL queries on PostgreSQL databases to safely explore and analyze data.

Instructions

Execute a read-only SQL query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conn_nameYesConnection name - see server instructions for available connections
sqlNoSQL to runall
Behavior2/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It mentions 'read-only', which is good, but lacks details on error handling, performance implications, auth requirements, or the meaning of the default SQL value 'all'. This is insufficient for a tool that executes arbitrary SQL.

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

Conciseness4/5

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

The description is a single, concise sentence with no waste. However, it is so brief that it sacrifices completeness. While efficient, a slightly longer description could improve clarity without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 params, no enums, no output schema), the description should still explain return format, error behavior, and the meaning of default 'all'. It fails to cover these essential aspects, making it incomplete.

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 descriptions already cover both parameters (conn_name and sql) with 100% coverage. The description adds no additional meaning beyond the schema, so baseline score of 3 applies. The description does not clarify the default 'all' behavior or connection reference.

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 'Execute a read-only SQL query' clearly states the action (execute) and resource (SQL query), and explicitly indicates it's read-only, distinguishing it from write operations. Compared to siblings like get_object_details and list_objects, this tool is for arbitrary SQL queries, so the purpose is distinct.

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 does not provide explicit guidance on when to use this tool versus alternatives like get_object_details or list_schemas. The read-only hint implies it's for queries only, but no direct comparison or exclusion criteria are given, leaving the agent to infer usage context.

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/andre-c-andersen/pg-mcp'

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