Skip to main content
Glama

Execute read-only SQL query

execute_read_only_query

Runs a SELECT-style query against the connected Postgres database inside a READ ONLY transaction. Any query containing mutation keywords (DROP, DELETE, ALTER, INSERT, UPDATE, etc.) is rejected before execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SQL statement to execute.
limitNoMaximum rows to return. Defaults to 100, hard cap 1000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
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 meaningfully disclose two behavioral traits: queries execute inside a READ ONLY transaction, and statements containing mutation keywords are rejected before execution. It omits error surface (how a rejection is reported), timeouts, or result-shape behavior, so it is strong but not exhaustive.

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, no filler, with the core guarantee (read-only execution) front-loaded ahead of the enforcement detail. Every clause earns its place.

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 two-parameter query tool with fully documented params and no annotations, the description covers the essential safety contract an agent needs before calling it. The gaps are return-value shape and error reporting, which have no output schema to cover them, but neither blocks correct invocation.

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%, and the schema already documents both the sql statement and the limit (default 100, hard cap 1000). The description adds no syntax, multi-statement, or row-limit detail beyond that, so the baseline of 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?

The description names a specific verb (runs), a resource (a SELECT-style query), and the execution target (connected Postgres database), so the agent knows exactly what the tool does. It does not mention the sibling get_database_schema, so it stops short of explicit differentiation at the 5 level.

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?

Usage is implied by the constraint that only SELECT-style reads are permitted, which tells the agent when this tool is appropriate versus a write path. However, it never says when to use get_database_schema first to discover tables, nor does it name any alternative for mutation needs, so the guidance stays implicit rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources