execute_mutation
Execute SQL write operations (INSERT, UPDATE, DELETE, DDL) with confirmation and snapshot rollback. Use verbosity=minimal to get only affected row counts.
Instructions
Ejecuta una mutacion (INSERT, UPDATE, DELETE, DDL). Pide confirmacion y crea snapshot para rollback. El result se comprime por defecto — para mutations usa verbosity=minimal si solo te interesa affectedRows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Sentencia SQL de escritura | |
| params | No | Parametros para prepared statement | |
| verbosity | No | Controls result detail to save context tokens. Default: 'normal'. - 'minimal': Only rowCount, executionTimeMs, affectedRows, and preview of first row. USE FOR: INSERT/UPDATE/DELETE where you only need to confirm success, COUNT queries, health-style SQL ("SELECT 1"), polling a job status. SAVES: ~90-95% tokens. - 'normal' (DEFAULT): Full rows but each CELL truncated to max_cell_bytes. Preserves table structure. Cells flagged with trailing '…(+NB)' marker when truncated. USE FOR: most SELECT debugging — browsing tables with TEXT/JSONB columns, exploring data. SAVES: ~60-80% tokens on tables with large columns (content, html, json payloads). - 'full': Entire result untouched. SAME SHAPE AS pre-compression releases. USE FOR: when you explicitly need the complete value of every cell. If a cell is truncated you can call inspect_last_query({ call_id }) to recover the full result WITHOUT re-executing the SQL (preserves DB load and any side-effects). | |
| only_columns | No | Return only these columns from the result (client-side projection after fetch). Cheaper than full when the SQL already returned extra columns you don't need. Example: ["id", "title", "slug"] drops all other columns from the response. | |
| max_cell_bytes | No | Max bytes per cell for verbosity='normal' (default: 500). Cells longer than this are truncated with '…(+NB)' suffix. Ignored for minimal/full. | |
| max_rows_in_response | No | Cap rows returned to the agent (does NOT change the SQL LIMIT). Useful to peek at a big result. Default: no cap beyond SQL LIMIT. |