update_item
Updates selected fields of a single Directus item by primary key while leaving omitted fields unchanged; pass a draft version for versioned collections.
Instructions
Updates fields of one item by primary key and leaves fields absent from data untouched: a PATCH, not a replace. Use create_item for a new row, bulk_operations for many rows, delete_items to remove them. In versioned collections the published item is read-only, so pass version with a draft key to write into a draft; without it Directus refuses the write. Overwrites whatever the field held, so read it with get_collection_items first when the previous value matters. Returns the updated item.
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": {
"collection": "<collection>",
"id": "<id>",
"data": "<data>"
},
"name": "update_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Item ID | |
| data | Yes | Updated data | |
| version | No | Draft version key to write into. Published items in versioned collections cannot be edited directly. | |
| collection | Yes | Collection name |