Skip to content

edit_table_data

MCP tools › Databases

Edit rows of a table: update cells, insert and delete rows. Rows are identified by the primary key (or a NOT NULL unique index); updates and deletes also check the loaded values, so rows changed since loading are reported as conflicts. Without apply=true only the SQL is returned. With apply=true all changes run in one transaction and are rolled back completely on any conflict or error (needs read-schema, and modify-data to apply).

Its results carry text from database: the client is told to treat that as data, never as instructions.

Capabilitydatabase.edit_table_data
AreaDatabases
Accesschanges database
Reachesdatabase, network
Rightsssh, database-permission, trusted-project
Dry runapply, on unless the call turns it off

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
tablerequiredstringTable name.
changesrequiredarray of object | object | objectChanges in order.
applybooleanApply the changes in one transaction (default: only return the SQL).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project edit_table_data '{"connection":"<string>","table":"<string>","changes":[]}'
Input schema as JSON
{
"properties": {
"connection": {
"description": "Connection name from `list_connections`.",
"type": "string"
},
"table": {
"description": "Table name.",
"type": "string"
},
"changes": {
"description": "Changes in order.",
"type": "array",
"items": {
"$ref": "#/$defs/ChangeArg"
}
},
"apply": {
"description": "Apply the changes in one transaction (default: only return the SQL).",
"type": [
"boolean",
"null"
]
}
},
"$defs": {
"ChangeArg": {
"description": "One change of `edit_table_data`. Values are strings, numbers, booleans or null.",
"oneOf": [
{
"description": "Change cells of one row.",
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "update"
},
"row": {
"description": "The row as loaded: key columns and the old values of the changed columns.",
"type": "object",
"additionalProperties": true
},
"set": {
"description": "New values by column.",
"type": "object",
"additionalProperties": true
}
},
"required": [
"kind",
"row",
"set"
]
},
{
"description": "Add a row; columns left out get their defaults.",
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "insert"
},
"values": {
"description": "Values by column.",
"type": "object",
"additionalProperties": true
}
},
"required": [
"kind",
"values"
]
},
{
"description": "Delete one row.",
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "delete"
},
"row": {
"description": "The row as loaded: key columns and any values to check before deleting.",
"type": "object",
"additionalProperties": true
}
},
"required": [
"kind",
"row"
]
}
]
}
},
"required": [
"connection",
"table",
"changes"
],
"type": "object"
}