Create item
create_itemCreate an inventory item. Requires the manager role. A category is required unless isDraft is true: a call without categoryId returns { missingCategory, categories } and writes nothing. The server checks that the category exists, not that it fits the item. Required fields per category come from get_item_requirements; when some are missing the call returns { missingFields } and creates nothing, and the same call with those values in customFields (keys = fieldDefId) creates the item. isDraft: true saves an incomplete draft without the required-field and category checks, which the user finishes in the app. At the organization's item allowance the call returns { itemLimitReached } and creates nothing; drafts do not count against the allowance and can still be saved at it. For quantity-tracked stock (consumables like paper or markers) pass trackingMode "quantity" with quantity and an optional minStock. With clientRequestId a repeated call returns the existing item instead of a duplicate; without it every call creates a new item. preview_item_create renders the same proposal as an editable confirm card in widget hosts; its button calls this tool.
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": {
"name": "<name>"
},
"name": "create_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Item name (required) | |
| isDraft | No | Save as an incomplete draft (skips the required-fields check; the user finishes it in the app) | |
| minStock | No | Optional restock threshold for quantity-tracked stock | |
| quantity | No | Initial stock amount — required with trackingMode "quantity" | |
| categoryId | No | Category id (from get_item_requirements); required unless isDraft is true | |
| description | No | ||
| customFields | No | Field values keyed by fieldDefId (from get_item_requirements). Dates as a plain calendar day "YYYY-MM-DD" (a full timestamp works too, but only WITH an explicit offset — this server has no timezone and does no conversion), selects as one of the listed options, multiselect as an ARRAY of option strings, currency as a plain number in the field's own currency (see its currencyCode; default CHF), url as a full http(s) link (protocol added when missing). | |
| trackingMode | No | "quantity" for quantity-tracked stock (consumables) instead of a serialized single item | |
| homeLocationId | No | Home location resource id (from search_resources); absent = the category or organization default | |
| clientRequestId | No | A unique id for this creation (e.g. a UUID). A repeated call with the SAME id returns the existing item instead of creating a duplicate; a new id creates a new item. | |
| responsiblePersonId | No | Responsible person resource id (optional) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Item id | |
| name | No | Item name | |
| usage | No | Tracked items the organization has, with itemLimitReached | |
| status | No | Condition: available | in_repair | defect | lost | retired ("available" means not defect/lost/retired — the item may still be borrowed) | |
| webUrl | No | Link to this item in the web app, for a person to open. Absent when the deployment has no public address configured | |
| isDraft | No | Present and true only for an unfinished draft capture | |
| modelId | No | The item's model — pass it as create_order lines[].modelId to order any instance of this model | |
| category | No | Category name | |
| quantity | No | How many this row stands for — only on quantity-tracked pools. To count a pool, SUM this; to count serialized items, count rows | |
| allowance | No | Items the organization's package includes, with itemLimitReached | |
| container | No | The container this item is packed into, if any | |
| modelName | No | The model's name | |
| categories | No | The organization's category tree, sent with a missingCategory round so the retry costs one call. Empty means the org has no categories yet | |
| compartment | No | The compartment of that container the item sits in (absent = directly in the container) | |
| description | No | Item description | |
| instruction | No | Explanation of a round that wrote nothing (missing fields, missing category, allowance reached) | |
| primaryCode | No | The code printed on the item's asset tag — how a human tells two identical models apart. Absent when no code is attached | |
| homeLocation | No | Where the item belongs | |
| trackingMode | No | "quantity" for a stock pool counted by amount. Absent = a serialized item, i.e. this row IS one physical thing | |
| contentsCount | No | Direct contents count — containers only | |
| currentHolder | No | Person currently holding it | |
| missingFields | No | Present INSTEAD of the item when required values are missing: nothing was created; the same call with these values in customFields creates it | |
| currentLocation | No | Where the item is now | |
| effectiveHolder | No | Holder followed through the container chain | |
| missingCategory | No | Present and true when the call carried no categoryId — nothing was created; every item except a draft needs a category | |
| itemLimitReached | No | Present and true when the organization is at its included item allowance — nothing was created and no retry of this call will succeed | |
| effectiveLocation | No | Location followed through the container chain | |
| responsiblePerson | No | Person responsible | |
| missingFieldLabels | No | Labels a saved DRAFT still needs before it can be published — the user finishes them in the app |