Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Run SELECT

run_select
Read-only

Validate and run read-only SQL queries, rejecting writes, DDL, and unsafe statements before execution.

Instructions

Validate and run a read-only SQL query. Writes, DDL, and other unsafe statements are rejected before execution.

Example: run_select(sql='SELECT id, email FROM users LIMIT 10', max_rows=1000)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
max_rowsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
columnsYes
row_countYes
truncatedYes
Behavior4/5

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

Description adds behavioral context beyond the readOnlyHint annotation by stating that writes/DDL are rejected before execution. This helps the agent understand the safety mechanism. The example gives a practical sense of usage. No contradictions with annotations.

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 plus an example: no wasted words. The purpose is stated first, followed by the key safety constraint, and then an illustrative example. Every sentence earns its place.

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?

Given that an output schema exists, the description doesn't need to explain return values. Annotations cover read-only nature. The description explains the core behavior and safety, which is sufficient for a simple tool. Minor gap: no mention of error handling or bounds on max_rows.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description only indirectly explains the 'sql' parameter via the example. The 'database' parameter is described in the schema (but not in the description), and 'max_rows' has no description at all. With only 33% schema coverage, the description fails to add meaningful parameter guidance beyond what the schema already provides.

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?

Clearly states 'Validate and run a read-only SQL query' and explicitly distinguishes from unsafe operations. The tool name and description align perfectly, and it stands out among siblings with similar names (run_select_parallel, run_select_tuned) by specifying the core read-only SELECT functionality.

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?

Explicitly says writes/DDL are rejected, implying this is for read-only queries. Provides a concrete example showing typical usage. However, it does not mention when to use alternatives like run_select_parallel or run_select_tuned, which could be valuable context for the agent.

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/devopam/MCPg'

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