Changes and migrations · stop 4 of 10

execute_sql

Runs an INSERT, UPDATE or DELETE.

Needs write modeTool sets: full

You might ask

“Mark order 1042 as refunded.”

Your assistant may call execute_sql to answer.

How it works

  • Needs write mode. DDL through this tool needs admin mode.
  • Runs inside a transaction. Any error rolls everything back. dry_run: true runs it and rolls back, with before-and-after snapshots of the affected rows.
  • timeout_ms may raise the time limit for a big batch, up to 10 minutes (NEXQL_MCP_MAX_TIMEOUT_MS).

Parameters

sqlstringrequired
A single DML statement (INSERT/UPDATE/DELETE), or DDL if the session is in admin mode.
dry_runboolean
If true, execute then roll back so no change persists. Default false.
include_diffboolean
When true (default when dry_run), capture before/after row snapshots for UPDATE/DELETE.
timeout_msnumber
Override statement_timeout for this call, in milliseconds. Unlike run_select, may exceed the profile's configured ceiling — useful for bulk INSERT/DDL. Bounded by NEXQL_MCP_MAX_TIMEOUT_MS.

What your assistant reads

The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.

Execute DML (and DDL in admin mode) inside an explicit transaction. Set dry_run=true to roll back after execution. Errors always roll back.