Skip to main content
Glama

CMO Studio: deploy and host AI-built apps

Run SQL

run_sql
Destructive

Run SQL on a Postgres database as its own login (reads and writes; 500 rows at most come back, 30 s per run). Prefer app migrations for schema changes.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "slug": "<slug>",
      "sql": "<sql>"
    },
    "name": "run_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL
slugYesDatabase slug

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

The destructiveHint=true annotation already signals mutation risk, and the description usefully adds real constraints: a 500-row return cap, a 30-second per-run timeout, and the fact that it executes under its own login. What's missing is behavior on timeout or partial writes, transaction/rollback semantics, and error surfacing — all relevant for a destructive query tool running against production.

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 dense sentences with zero filler: capability and identity first, then limits, then the migration exception. Front-loaded and fully earns its space.

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 raw SQL tool with no output schema, the definition covers identity, mutation permission, row cap, and timeout — the essentials an agent needs before calling. It stops short of describing returned column shape or error behavior, which matters because there's no output schema to fall back on.

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 coverage is reported at 100%, but the schema text is just "SQL" and "Database slug." The description adds the meaningful fact that the slug denotes the target Postgres database and the login context used, but does not clarify slug format, scope, or SQL dialect specifics. Baseline 3 given schema does the formal heavy lifting.

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?

States a specific verb and resource: "Run SQL on a Postgres database," plus execution identity ("as its own login"). An agent knows exactly what it does; it simply doesn't need to differentiate this from any sibling since none of the listed names offers SQL execution.

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 an explicit exclusion: schema changes should go through app migrations rather than this tool. It also flags that both reads and writes are permitted, so an agent knows it can mutate via SQL. It does not mention any read-only advisory alternative, but the schema-change exclusion is the main routing decision here.

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.