Save Custom Field
save_custom_fieldCreate, restore or edit one custom field definition. Check for a built-in first: a custom field is plain data that reorder recommendations, purchasing, pricing, reports and fulfillment never read. Omit id to create: entity, name, type, purpose and purposeDetail are required, and fieldName (the storage key) is derived from name when omitted. On an item, a purpose a built-in covers (reorder policy, supplier, category/brand/group, lifecycle, pricing, barcode, tracking, units, dimensions, location, components, tags, notes) is refused with BUILT_IN_ALTERNATIVE naming that built-in: show it to the user, and create the field only if they still want it, with builtInReviewed=true. Creating the entity.fieldName of a deleted field restores it with the values records still carry, so it must keep its type; the preview says so and counts those records. Pass id to edit, where every omitted field keeps its value; entity, fieldName and type never change. Options for list/multilist fields are matched by id, then name, so kept options keep the values pointing at them; options left out are removed, and the preview counts the records whose value they strand. A field active price books depend on keeps the options they reference. Requires an operator (unpinned) credential. For bulk onboarding use upsert_custom_fields.
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": {
"input": "<input>"
},
"name": "save_custom_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The custom field id (GUID) to edit; omit to create or restore. | |
| input | Yes | The definition to save; see upsert_custom_fields for each property. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| deleted | No | ||
| preview | No | ||
| expiresAt | No | ||
| customField | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |