Skip to main content
Glama
adaptive-pg-mcp (PostgreSQL)

adaptive-pg-mcp (PostgreSQL)

query_sql

Read-onlyIdempotent

Run a single SQL statement in a read-only transaction to inspect data safely. Returns up to 1,000 rows, caps output at 1 MB, and times out after 30 seconds.

Instructions

Runs one SQL statement in a read-only transaction, so it cannot change data. Returns at most 1,000 rows and 1,048,576 bytes. Times out after 30s.

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SQL statement, sent to Postgres unchanged. More than one statement is refused.
databaseYesThe database to run on.

Output Schema

NameRequiredDescriptionDefault
rowsYesThe result rows, each an array in column order.
columnsYesThe result columns, in order.
truncatedYesTrue when the row cap, the byte cap or limit cut off more rows.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is structured. The description still adds behavior annotations cannot express: a 1,000-row cap, a 1,048,576-byte cap, and a 30s timeout — exactly the operational limits an agent needs to anticipate truncated results. It stops short of saying whether hitting a cap truncates silently or errors, which is the one missing piece.

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?

Three short sentences, front-loaded with the operation and its safety guarantee, followed by concrete limits. No filler and nothing repeated from the title or schema verbatim.

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?

An output schema exists, so return values need not be explained, and the description covers the mutation-safety question and the resource caps. Relative to a two-parameter query tool that is nearly complete; only the truncation-vs-error behavior at the row/byte limits is left unspecified.

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 coverage is 100%, so both parameters are already documented, including the single-statement constraint and the database enum. The description's "one SQL statement" and the read-only framing add emphasis but no meaning beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Runs one SQL statement") plus a scope qualifier ("in a read-only transaction"), which is much stronger than a name restatement. It does not distinguish itself from the near-identical siblings execute_sql and execute_ddl, nor from aggregate/read_rows, so an agent cannot tell from the description alone which of those overlapping tools to pick.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"so it cannot change data" implies the tool is for read queries, but there is no explicit when-to-use instruction. With eleven siblings including execute_sql, execute_ddl, aggregate, and read_rows, the absence of any routing guidance (e.g. "use aggregate for GROUP BY summarization") is a real gap.

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