Skip to main content
Glama

Run SQL

sql.execute
Destructive

Run SQL on a branch as the project's database role (never a superuser). Read-only by default. For writes pass read_only: false (database:write). DROP, TRUNCATE, ALTER ... DROP and DELETE/UPDATE without WHERE are destructive: they need confirm: true plus the destructive scope, and on production also production:destructive. Prefer migrations.apply for schema changes. Scope: database:read.

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": {
      "query": "<query>"
    },
    "name": "sql.execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows to return (default 100)
queryYesSQL. Read-only mode takes one statement; write mode takes a script run in one transaction.
branchNoBranch (environment) id. Optional: defaults to `production`.
confirmNoMust be true to run a destructive operation, after the user approved it
read_onlyNoDefault true. Set false to write (needs database:write).
project_idNoProject id. Optional: defaults to the project created or used last in this session, or the only one.
organization_idNoOrganization id. Optional: defaults to the token's organization, or the only one you belong to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false, so the safety profile is partly free. The description still adds real value beyond them: the non-superuser role, read-only-by-default behavior, the permission scopes required per mode (database:read, database:write, production:destructive), and the user-approval precondition for confirm. It stops short of error/rollback semantics, but the destructive gate and auth requirements are covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the mode and default, then escalates to the destructive gate and the sibling alternative. Every clause carries a distinct constraint, though the telegraphed fragments ('ALTER ... DROP') and the trailing 'Scope: database:read' read slightly like notes rather than prose.

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 7-parameter mutation tool with no output schema, the description covers identity, default mode, write escalation, destructive confirmation, environment-specific scopes, and the preferred alternative for schema work. Only return/error behavior is left implicit, which the row-limit parameter partly mitigates.

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%, so every parameter is already documented, setting a baseline of 3. The description does add the coupling that read_only: false requires database:write and that confirm: true is tied to destructive scope, which is meaning not present in the schema text for those fields.

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 and resource ('Run SQL on a branch') plus the execution identity ('as the project's database role, never a superuser'), which is the key differentiator from an admin console. It also names the sibling it is not meant for ('Prefer migrations.apply for schema changes'), so an agent can route without opening either 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 (ad-hoc SQL reads), when-to-use-differently (schema changes go to migrations.apply), and the exact conditions that gate the risky path: read_only: false for writes, confirm: true plus destructive scope for DROP/TRUNCATE/ALTER...DROP and WHERE-less DELETE/UPDATE, plus production:destructive on production. No inference is required.

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