Skip to main content
Glama
Nam088

mcp-server-db

by Nam088

pg_query

Query a Postgres database with read-only SELECT statements. Use an optional connection ID to select the database connection.

Instructions

Run a read-only SELECT query against a configured Postgres connection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA SELECT statement.
connectionIdNoId of the postgres connection to use, from databases.config.yml. Optional when only one postgres connection is configured.
Behavior2/5

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

No annotations are provided, so the description bears full responsibility. It only discloses the read-only nature but omits other important behaviors such as result format, limits on query size or duration, error handling, or whether multiple statements are supported. This leaves significant gaps for a query-executing tool.

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 a single, well-structured sentence that front-loads the key constraint (read-only) and clearly states the action and target. Every word earns its place with no redundancy.

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?

For a tool with two parameters and no output schema, the description is adequate but incomplete. It does not hint at the return format (e.g., JSON), pagination, or error behavior. Compared to siblings like pg_explain_query, more context would be beneficial, but given the simplicity, it meets a minimum viable standard.

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 description coverage is 100% (both parameters have descriptions). The description adds the 'read-only SELECT query' context, but the parameter descriptions in the schema already define 'sql' and 'connectionId' adequately. The description does not add substantial meaning beyond the schema, so a 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 the tool runs a read-only SELECT query against a configured Postgres connection, specifying the verb 'run', the resource 'SELECT query', and the target 'Postgres connection'. This distinguishes it from sibling tools like pg_execute_sql (which likely allows writes) and listing tools.

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 marks the tool as read-only, indicating when to use it for queries versus other tools that allow modifications. However, it does not explicitly state when not to use it or provide direct comparisons to alternatives like pg_execute_sql for write operations.

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/Nam088/mcp-database-server-v2'

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