Validate and apply explicit edits. Pass recipeId for a persisted cooking session, or pass the full recipe payload from display_recipe to edit an unsaved card without persistence. Does NOT modify the saved recipe in your library.
View input schema
{
"type": "object",
"properties": {
"recipeId": {
"type": "string",
"minLength": 1
},
"recipe": {
"type": "object",
"required": [
"id",
"title",
"meta",
"ingredients",
"steps",
"notes"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"description": {
"type": "string"
},
"summary": {
"type": "string"
},
"images": {
"type": "array",
"items": {
"type": "string"
}
},
"meta": {
"type": "object",
"properties": {
"cuisine": {
"type": "string"
},
"course": {
"type": "string"
},
"meal": {
"type": "string"
},
"yieldText": {
"type": "string"
},
"prepTimeMin": {
"type": "number"
},
"cookTimeMin": {
"type": "number"
},
"totalTimeMin": {
"type": "number"
}
},
"additionalProperties": false
},
"ingredients": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "number"
},
"quantityText": {
"type": "string"
},
"unit": {
"type": "string"
},
"unitSystem": {
"type": "string",
"enum": [
"metric",
"imperial",
"count",
"other"
]
},
"name": {
"type": "string"
},
"preparation": {
"type": "string"
},
"note": {
"type": "string"
},
"section": {
"type": "string"
}
},
"additionalProperties": false
}
},
"steps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"substeps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"timerMin": {
"type": "number"
},
"timerLabel": {
"type": "string"
}
},
"additionalProperties": false
}
},
"timerMin": {
"type": "number"
},
"section": {
"type": "string"
},
"ingredientIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"notes": {
"type": "array",
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"sessionId": {
"type": "string"
},
"reply": {
"type": "string",
"minLength": 1
},
"editLabel": {
"type": "string",
"minLength": 1
},
"measurementSystem": {
"type": "string",
"enum": [
"source",
"metric",
"imperial"
]
},
"patches": {
"type": "array",
"minItems": 1,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"ingredientId",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "replace-ingredient"
},
"ingredientId": {
"type": "string"
},
"oldValue": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "number"
},
"quantityText": {
"type": "string"
},
"unit": {
"type": "string"
},
"unitSystem": {
"type": "string",
"enum": [
"metric",
"imperial",
"count",
"other"
]
},
"name": {
"type": "string"
},
"preparation": {
"type": "string"
},
"note": {
"type": "string"
},
"section": {
"type": "string"
}
},
"additionalProperties": false
},
"newValue": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "number"
},
"quantityText": {
"type": "string"
},
"unit": {
"type": "string"
},
"unitSystem": {
"type": "string",
"enum": [
"metric",
"imperial",
"count",
"other"
]
},
"name": {
"type": "string"
},
"preparation": {
"type": "string"
},
"note": {
"type": "string"
},
"section": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "insert-ingredient"
},
"afterIngredientId": {
"type": "string"
},
"newValue": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "number"
},
"quantityText": {
"type": "string"
},
"unit": {
"type": "string"
},
"unitSystem": {
"type": "string",
"enum": [
"metric",
"imperial",
"count",
"other"
]
},
"name": {
"type": "string"
},
"preparation": {
"type": "string"
},
"note": {
"type": "string"
},
"section": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"ingredientId"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "remove-ingredient"
},
"ingredientId": {
"type": "string"
},
"oldValue": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "number"
},
"quantityText": {
"type": "string"
},
"unit": {
"type": "string"
},
"unitSystem": {
"type": "string",
"enum": [
"metric",
"imperial",
"count",
"other"
]
},
"name": {
"type": "string"
},
"preparation": {
"type": "string"
},
"note": {
"type": "string"
},
"section": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"stepId",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "replace-step"
},
"stepId": {
"type": "string"
},
"oldValue": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"substeps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"timerMin": {
"type": "number"
},
"timerLabel": {
"type": "string"
}
},
"additionalProperties": false
}
},
"timerMin": {
"type": "number"
},
"section": {
"type": "string"
},
"ingredientIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"newValue": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"substeps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"timerMin": {
"type": "number"
},
"timerLabel": {
"type": "string"
}
},
"additionalProperties": false
}
},
"timerMin": {
"type": "number"
},
"section": {
"type": "string"
},
"ingredientIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "insert-step"
},
"afterStepId": {
"type": "string"
},
"newValue": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"substeps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"timerMin": {
"type": "number"
},
"timerLabel": {
"type": "string"
}
},
"additionalProperties": false
}
},
"timerMin": {
"type": "number"
},
"section": {
"type": "string"
},
"ingredientIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"stepId"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "remove-step"
},
"stepId": {
"type": "string"
},
"oldValue": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"substeps": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"timerMin": {
"type": "number"
},
"timerLabel": {
"type": "string"
}
},
"additionalProperties": false
}
},
"timerMin": {
"type": "number"
},
"section": {
"type": "string"
},
"ingredientIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"field",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "update-meta"
},
"field": {
"type": "string",
"enum": [
"title",
"subtitle",
"description",
"summary",
"cuisine",
"course",
"meal",
"yieldText",
"prepTimeMin",
"cookTimeMin",
"totalTimeMin"
]
},
"oldValue": {},
"newValue": {}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"newValue"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "replace-images"
},
"oldValue": {
"type": "array",
"items": {
"type": "string"
}
},
"newValue": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"note"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "add-note"
},
"note": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"requestId",
"editId",
"reason",
"noteIndex"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1
},
"editId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"type": {
"const": "remove-note"
},
"noteIndex": {
"type": "integer",
"minimum": 0
},
"oldValue": {
"type": "string"
}
},
"additionalProperties": false
}
]
}
}
},
"required": [
"patches"
],
"anyOf": [
{
"required": [
"recipeId"
]
},
{
"required": [
"recipe"
]
}
],
"additionalProperties": false
}