Skip to main content
Glama
Automata MCP

Automata MCP

Run a data-modifying SQL statement

run-statement
Destructive

Execute a single PostgreSQL INSERT, UPDATE, DELETE, or MERGE and report rows changed, rolling back the transaction if affected rows exceed maxRows or a table falls outside the allowlist.

Instructions

[PostgreSQL] Run one INSERT, UPDATE, DELETE or MERGE and report how many rows it changed. Exactly one statement; DDL, TRUNCATE, COPY and CREATE TABLE AS are refused. Every table it reads or writes must be inside this connector's allowlist. It runs inside a transaction with a row cap: if the statement turns out to affect more rows than maxRows, the whole transaction is rolled back and NOTHING changes — so set maxRows to what you actually intend to change, and read a cap error as "my WHERE clause was wider than I thought" rather than as a limit to raise blindly. An UPDATE or DELETE with no WHERE clause is refused unless you pass allowWholeTable: true, which is deliberately a separate decision from the SQL. Add RETURNING when you need to see what changed; returned cells are clipped at 2000 characters unless you pass fullValues: true. This tool cannot see inside triggers: a write to an allowed table may cascade to tables outside the allowlist, and the allowlist cannot stop that. Confirm destructive changes with the user before calling this.

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": {
      "sql": "<sql>"
    },
    "name": "run-statement"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne INSERT, UPDATE, DELETE or MERGE statement
maxRowsNoRoll the whole statement back if it would affect more rows than this
timeoutMsNoServer-side statement timeout, in milliseconds
fullValuesNoReturn every cell whole instead of clipping each at 2000 characters. Set it only when you need a long text or JSON value in full: a page of large cells can make a very large response.
allowWholeTableNoPermit an UPDATE or DELETE with no WHERE clause. Off by default: a missing WHERE is far more often a mistake than an intention. `maxRows` still applies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description goes well beyond them: transactional rollback semantics on row-cap breach, allowlist enforcement, the trigger-cascade blind spot that the allowlist cannot stop, and 2000-character clipping of returned cells. That trigger caveat in particular is behavioral knowledge an agent cannot get from the annotations or schema.

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 core operation, then layered constraints in rough order of importance. It is on the long side at eight sentences, but nearly every one carries a distinct constraint or failure mode; the RETURNING/clipping sentence is the only one that could be tightened by leaning harder on the schema.

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?

No output schema exists, and the description compensates by explaining what comes back (affected row count, optional RETURNING values with clipping) and what happens on failure (full rollback). For a destructive, open-world write tool with five parameters, this covers the safety, scoping, and return-shape information an agent needs.

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 the baseline is 3, but the description adds real meaning: `maxRows` is framed as an intent declaration whose breach rolls back everything, `allowWholeTable` is framed as a deliberate separate decision from the SQL, and `fullValues` is tied to response-size risk. It reinforces rather than duplicates the schema, though it does not cover `timeoutMs` at all.

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 set ('Run one INSERT, UPDATE, DELETE or MERGE') scoped to PostgreSQL and to a single statement, and distinguishes itself from a read path by naming exactly which statement classes it refuses. An agent can immediately tell this is the write tool, not the SELECT tool.

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?

Explicit when-to-use and when-not: DDL, TRUNCATE, COPY and CREATE TABLE AS are refused; UPDATE/DELETE without WHERE requires a separate allowWholeTable decision; RETURNING should be added when the caller needs to see changes; destructive changes should be confirmed with the user first. The `maxRows` guidance even tells the agent how to interpret a cap error rather than treating it as a limit to raise.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.