insert_rows
Inserts rows into a PostgreSQL table. Rolls back calls changing more than 100 rows, triggers and cascades included, and returns affected count plus requested returning rows.
Instructions
Inserts rows into one table. Rolls back a call that changes more than 100 rows, triggers and cascades included. Returns rowsAffected and up to 1,000 returning rows.
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": {
"database": "<database>",
"table": "<table>",
"rows": "<rows>"
},
"name": "insert_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The rows to insert. An omitted column takes its default. | |
| table | Yes | The table or view to insert into, by exact name. | |
| schema | No | The schema, by exact name. Defaults to public. | |
| database | Yes | The database to run on. | |
| returning | No | Columns to return from each changed row. Omit to return none. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The result rows, each an array in column order. | |
| columns | Yes | The result columns, in order. | |
| rowsAffected | Yes | The number of rows changed. |