mssql_execute_mutation
Insert, update, delete, or upsert rows in SQL Server tables by specifying operation, table, and data. Use optional WHERE clause for targeted modifications.
Instructions
Execute data modification operations (INSERT/UPDATE/DELETE/UPSERT) - operation="insert/update/delete/upsert" with table and data. Examples: operation="insert", table="Users", data={"Name":"John","Email":"john@example.com"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Data object with column-value pairs (required for insert/update/upsert). Values are always bound as parameters. | |
| table | Yes | Table name for the operation | |
| where | No | WHERE clause for update/delete operations (without WHERE keyword). Use @w1, @w2 (or $1, $2) with whereParameters. | |
| schema | No | Schema name (defaults to dbo) | |
| operation | Yes | Mutation operation: insert (add rows), update (modify rows), delete (remove rows), upsert (insert or update) | |
| returning | No | Columns to return via OUTPUT: "*" or a comma-separated list | |
| conflictColumns | No | Key columns for upsert (MERGE ... ON) | |
| whereParameters | No | Parameter values for @w1, @w2, ... placeholders in the where clause | |
| connectionString | No | SQL Server connection string (optional; requires --allow-tool-connection-string) |