Enforcing check_balance before deduct_funds in an OpenAI agent

OAI-SE Structured Outputs & Strict JSON Schemas Medium Question 21 of 24

Larkfield Payments runs an agent with check_balance, deduct_funds and create_label tools on gpt-5.6-terra. In production the model sometimes calls deduct_funds and create_label in the same turn, before check_balance has returned.

Which combination stops the concurrent calls and enforces the required order?

Show answer and explanation

BSet parallel_tool_calls to false, and reject out-of-order calls in the handler itself

Setting parallel_tool_calls to false limits the model to zero or one tool call per turn, which stops the concurrent debit and label, but it does not decide which tool comes next, so the handler must refuse a debit or a label until check_balance has succeeded. Array order is not execution order, validating after all three have run is too late to prevent the debit, and tool_choice required only forces at least one call.

Source: developers.openai.com/api/docs/guides/function-calling

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 24 original OAI-SE practice questions