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.7/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, non-destructive), and the description adds hard behavioral constraints beyond them: max 500 rows, a 5-second limit, a single-statement restriction, and the read scope tied to describe_schema. These operational limits materially affect how an agent should call it.

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 tight sentences, zero filler, front-loaded with the core action and constraints, then the routing alternative. Every sentence earns its place.

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?

For a single-param, no-output-schema tool, the description covers action, scope, limits, prerequisites, and the mutation alternative. An agent has everything needed to decide to call it and to construct a valid statement; return values are implicitly the rows and need no separate output schema.

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 specifies 'A single SELECT (or WITH … SELECT) statement', which is what the description's 'ONE ... SELECT' phrasing conveys. The description adds no syntax, dialect, 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) plus the return shape (the rows back). It explicitly differentiates itself from siblings by naming describe_schema for readable objects and propose_write for mutations, so an agent can place it without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (read-only SELECT), when-not ('To change data, use propose_write'), and a prerequisite ('Only tables and columns listed by describe_schema are readable'). Both the alternative and the condition that selects it are stated, leaving nothing to inference.

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.