Overview
- Category
- Cooking
- API mode
execute- Processing
- client-side
- Privacy
- no-data-stored
Public descriptor
The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.
GET /api/v1/tools/recipe-scaler
Execute availability
This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.
POST /api/v1/tools/recipe-scaler/execute
Authentication is not issued during the preview. A bearer API key is planned for execution after launch.
Input schema
object object; additional properties are not accepted.
original_servings· number · required- Enter how many servings the original recipe makes.
desired_servings· number · required- Enter the number of people the resized recipe should serve.
ingredients· string · required- List one ingredient per line, keeping each quantity and unit so it can be scaled accurately.
{
"type": "object",
"properties": {
"original_servings": {
"type": "number",
"description": "Enter how many servings the original recipe makes."
},
"desired_servings": {
"type": "number",
"description": "Enter the number of people the resized recipe should serve."
},
"ingredients": {
"type": "string",
"description": "List one ingredient per line, keeping each quantity and unit so it can be scaled accurately."
}
},
"required": [
"original_servings",
"desired_servings",
"ingredients"
],
"additionalProperties": false
}
Output schema
On a successful execution, schema values appear in data.result.values.
scale_factor· number- Desired/original serving ratio.
target_servings· number- Requested serving count.
ingredients· array- Scaled ingredient rows.
{
"type": "object",
"properties": {
"scale_factor": {
"type": "number",
"description": "Desired/original serving ratio."
},
"target_servings": {
"type": "number",
"description": "Requested serving count."
},
"ingredients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"original": {
"type": "string"
},
"ingredient": {
"type": "string"
},
"original_amount": {
"type": [
"number",
"null"
]
},
"scaled_amount": {
"type": [
"number",
"null"
]
}
},
"required": [
"original",
"ingredient",
"original_amount",
"scaled_amount"
],
"additionalProperties": false
},
"description": "Scaled ingredient rows."
}
},
"additionalProperties": false
}
Scale a four-serving recipe to six
The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.
curl -X POST "https://utilitypages.org/api/v1/tools/recipe-scaler/execute" \
-H "Content-Type: application/json" \
-d '{
"original_servings": 4,
"desired_servings": 6,
"ingredients": "2 cups flour\n1 1/2 cups milk\n1/4 tsp salt"
}'
{
"ok": true,
"data": {
"slug": "recipe-scaler",
"result": {
"values": {
"scale_factor": 1.5,
"target_servings": 6,
"ingredients": [
{
"original": "2 cups flour",
"ingredient": "cups flour",
"original_amount": 2,
"scaled_amount": 3
},
{
"original": "1 1/2 cups milk",
"ingredient": "cups milk",
"original_amount": 1.5,
"scaled_amount": 2.25
},
{
"original": "1/4 tsp salt",
"ingredient": "tsp salt",
"original_amount": 0.25,
"scaled_amount": 0.375
}
]
},
"display": {
"display": "1.5"
},
"warnings": [],
"assumptions": [],
"steps": []
}
},
"meta": [],
"request_id": "req_example_123"
}
Errors
api_not_launched· 503- Returned by the current launch gate for every execute request.
invalid_json· 400- Returned when an enabled execute request does not contain valid JSON.
validation_failed· 422- Returned when a request does not satisfy the input schema.
browser_interaction_required· 422- Returned for browser capability tools instead of inventing a server-side result.
tool_not_found· 404- Returned when a requested descriptor slug does not exist.
execution_failed· 503- Returned when an enabled server-side execution cannot complete.