Skip to main content
Glama
mahin1995

postgres-mcp-readonly

by mahin1995

db.query

Execute read-only SELECT queries on PostgreSQL with optional row limits, parameter binding, and multi-statement support for non-parameterized SQL.

Instructions

Run one or more read-only SELECT queries with optional row limits. Multi-statement calls are allowed for non-parameterized SELECT/WITH statements; parameterized queries must be single-statement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo
maxRowsNo
databaseNo
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 well by disclosing read-only behavior, support for multi-statement non-parameterized queries, and the constraint that parameterized queries must be single-statement. It adds meaningful behavioral context beyond the bare schema.

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, front-loaded with the purpose, and each sentence adds distinct value—first stating what it does, second stating a key constraint. No waste.

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?

For a 4-parameter tool with no output schema, the description covers the main behaviors and constraints well. It does not describe the database parameter or result format, but the core usage is clear and sufficiently complete.

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 description coverage is 0%, so the description must compensate. It explains 'sql' as SELECT/WITH statements, 'params' as parameterized query values, and 'maxRows' as optional row limits. 'database' is not explicitly described, but the overall parameter meaning is significantly enriched.

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 the tool runs one or more read-only SELECT queries, which is a specific verb+resource action. It distinguishes from siblings like db.count, db.explain, and db.validate_sql by focusing on executing SELECT queries directly.

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 provides context on when multi-statement queries are allowed (non-parameterized SELECT/WITH) and requires single-statement for parameterized queries. However, it does not explicitly mention alternatives or when to prefer other sibling tools like db.preview or db.count, so usage guidance is implied rather than explicit.

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/mahin1995/postgres-mcp-readonly'

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