Skip to main content
Glama
mattcat10

postgres-mcp

by mattcat10

query_database

Execute SQL queries directly on PostgreSQL databases using natural language. Enables data retrieval and interaction for MCP-based workflows.

Instructions

Execute a SQL query on the PostgreSQL database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to execute

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden, yet it discloses nothing about whether writes/DDL are permitted, required permissions, row limits, timeouts, or reversibility. 'Execute a SQL query' leaves the entire safety profile of a database-mutating tool unspecified.

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?

One tight sentence with the action front-loaded and no filler. It is appropriately sized, though it errs toward under-specification rather than excess.

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?

For a raw SQL execution tool with no annotations and no output schema, the description should at minimum indicate read-only vs. write capability and any limits. As written, an agent cannot tell whether this tool is safe to call with arbitrary DML.

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% for the single 'query' parameter, so the baseline of 3 applies. The description adds no dialect hints, formatting rules, or constraints (e.g., parameterization, statement limits) beyond what the schema already states.

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 ('Execute') and resource ('SQL query on the PostgreSQL database'), which is enough to distinguish it from describe_table and list_tables by intent. It does not explicitly name those siblings, but the verb+resource pair makes the tool's role unambiguous.

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?

There is no guidance on when to use this versus describe_table or list_tables, nor any prerequisite such as inspecting the schema first. The agent must infer entirely from the description that this is the arbitrary-SQL escape hatch.

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

Deploy Server

Other Tools