Skip to main content
Glama

executePostgreSQLSqlQuery

Execute read-only SQL queries on a PostgreSQL database to retrieve data and return results, enabling safe database inspection.

Instructions

Executes a read-only SQL query against your PostgreSQL database and returns the results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to execute.
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 of behavioral disclosure. It explicitly states 'read-only,' which is a critical trait preventing the agent from attempting write operations. However, it does not disclose the result format, possible SQL restrictions, or error behavior, so it is not fully transparent.

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, concise sentence that front-loads the action and resource. It includes all essential information without redundancy, making it easy to parse and understand.

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?

The tool is simple with one parameter and no output schema, and the description covers the core action and read-only nature. However, it lacks a description of the result format (e.g., array of rows), which is important for an agent to parse the output correctly. There is also no mention of query restrictions or limitations, leaving some gaps in complete context.

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?

The input schema already describes the single 'query' parameter as 'The SQL query to execute,' giving 100% schema coverage. The description adds the read-only context but provides no additional parameter-level detail such as whether the query must be a single statement or how to handle semicolons, so it meets the baseline without exceeding it.

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 'Executes a read-only SQL query against your PostgreSQL database and returns the results.' It specifies the verb (executes), resource (PostgreSQL database), mode (read-only), and output (results), distinguishing it from sibling tools like executeSupabaseSqlQuery and executeNeonSqlQuery by naming PostgreSQL specifically.

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?

The description provides no guidance on when to use this tool versus alternatives such as executeSupabaseSqlQuery, executeNeonSqlQuery, or fetchPostgreSQLSchema. There is no mention of prerequisites, exclusions, or recommended use cases, so the agent must rely solely on the tool name for usage context.

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/grantanderson603-bit/mcp-d1839'

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