pg_execute_mutation
Execute INSERT, UPDATE, DELETE, or UPSERT operations in PostgreSQL databases to modify table data using specified parameters and conditions.
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"}
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": {
"operation": "<operation>",
"table": "<table>"
},
"name": "pg_execute_mutation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connectionString | No | PostgreSQL connection string (optional) | |
| operation | Yes | Mutation operation: insert (add rows), update (modify rows), delete (remove rows), upsert (insert or update) | |
| table | Yes | Table name for the operation | |
| data | No | Data object with column-value pairs (required for insert/update/upsert) | |
| where | No | WHERE clause for update/delete operations (without WHERE keyword) | |
| conflictColumns | No | Columns for conflict resolution in upsert (ON CONFLICT) | |
| returning | No | RETURNING clause to get back inserted/updated data | |
| schema | No | Schema name (defaults to public) | public |