Skip to main content
Glama

Faivelo Email

Run SQL on a database

run_sql
Destructive

Run SQL on a Postgres database. Read-only unless writes is true (then it can change or drop data: show the person the statement and get their go-ahead first; writes are recorded in the account's audit log). One statement result, the first 500 rows, 30 seconds at most. A statement Postgres refuses comes back with ok: false and its error. Use get_database_schema to see the tables first.

Input Schema

NameRequiredDescriptionDefault
idYesThe database's service id, from list_services
sqlYesThe SQL to run
writesNoAllow changes (INSERT, UPDATE, DDL). Off by default: a read-only transaction.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=true; the description goes well beyond them by stating the default is a read-only transaction, that writes can change or drop data, that writes are audit-logged, the 500-row/30-second limits, and the ok:false error return. That is exactly the behavioral context an agent needs before invoking a destructive tool.

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?

Four short sentences, front-loaded with the safe default and the risk carve-out, followed by result shape and limits. No sentence is filler; each adds a fact the caller must know.

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 no output schema, the description still documents the return shape (single statement result, first 500 rows, error surfaced as ok:false) plus time limits. Nothing an agent needs in order to call it correctly or interpret the response is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so a 3 is the baseline, but the description adds real meaning for writes: the approval workflow and audit-log consequence are not in the schema. The id parameter's provenance (list_services) is left to the schema description, which already covers 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?

Opens with a specific verb and resource ("Run SQL on a Postgres database") and scopes it precisely as read-only-by-default with an opt-in write mode. It is clearly distinguishable from get_database_schema, which it explicitly routes to for table discovery.

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?

Names the alternative (get_database_schema) and when to use it, and gives an explicit precondition for the risky path: only set writes=true after showing the person the statement and getting approval. When-not guidance is implicit but unambiguous.

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.