Skip to main content
Glama

run_sql

Read-only

Run ONE read-only PostgreSQL SELECT against the workspace's data and get the rows back (max 500 rows, 5-second limit). Only tables and columns listed by describe_schema are readable. To change data, use propose_write.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SELECT (or WITH … SELECT) statement.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the 500-row cap, the 5-second time limit, the single-statement restriction, and the schema-derived read scope. These are exactly the limits an agent needs to know to avoid failed or truncated queries, and none of them are present in readOnlyHint/openWorldHint.

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, zero filler, with the core capability and its hard limits front-loaded before the alternative-tool routing. Every clause carries operational information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a single parameter, no output schema (mode of return is stated as 'get the rows back'), and safety already covered by annotations, the description supplies the missing behavioral limits. An agent has everything needed to call it correctly.

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 there is only one parameter, so the schema already documents the SELECT/WITH…SELECT form. The description reinforces the 'ONE statement' constraint but adds no syntax or format detail 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.

Purpose5/5

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

States a specific verb (run) and resource (read-only PostgreSQL SELECT against the workspace's data), including the exact result shape ('get the rows back'). It is clearly distinguishable from siblings like propose_write and describe_schema, both of which it names.

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?

Gives explicit routing for mutations ('To change data, use propose_write') and a prerequisite for readable scope ('Only tables/columns listed by describe_schema'). It does not address when to prefer run_sql over the many purpose-built find_* / list_* sibling tools, which is the main remaining ambiguity.

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.