create_item
Insert a single row into a Directus collection and return the created item with its generated primary key. Validation errors abort the write, so nothing is saved.
Instructions
Inserts one item (row) into a collection and returns it, including the generated primary key. Use bulk_operations for many rows in one call, import_data for a CSV or JSON file, update_item to change a row that exists. Directus validates the payload, so a missing required field or a failed validation rule comes back as a tool error and nothing is written. Fields the token may not write are rejected rather than silently dropped. The payload may include relational fields, which Directus resolves against the related collection.
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>",
"data": "<data>"
},
"name": "create_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Item data | |
| collection | Yes | Collection name |