Simulate Order Placement
simulate_order_placementPlace a simulated order by validating stock for each item, decrementing inventory, and computing the total from current prices; reject the whole order if any item is unavailable.
Instructions
Write-action tool: places a new simulated order, validating stock availability for every line item, decrementing inventory counts, computing the order total from current catalog prices, and returning a success receipt with the updated stock levels. Rejects the entire order (no partial writes) if any item is unavailable or under-stocked. The whole read-validate-write runs inside the provider's transaction, so a concurrent order cannot both pass a stock check and oversell. This permanently changes the dataset until reset_demo_state is called.
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": {
"customer_name": "<customer_name>",
"items": "<items>"
},
"name": "simulate_order_placement"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | One or more line items for this order. | |
| customer_name | Yes | Full name of the customer placing the order. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receipt | Yes | ||
| success | Yes | ||
| updatedStockLevels | Yes |