Order the tool call

Intermediate · tools · function calling

Order the tool call

You are writing the spec for a small internal assistant that checks whether a meeting room is free and, after confirmation, moves a booking. The team building it needs the loop described in the right order — permissions and confirmation included.

Order the steps of a single tool-using request, from the user's question to the final answer.

  1. The tool executes and returns a real result — free, busy until 14:30, or an error.
  2. The model answers using the returned result, quoting what the calendar actually said.
  3. Any write — moving the booking — is proposed with details, confirmed by a human, then executed and reported.
  4. The user asks something the chat cannot answer from the conversation alone: “is Studio B free at 15:00 on Thursday?”
  5. The model proposes a tool call — tool name, room, date and time — with the purpose stated.
  6. The surrounding system checks permissions and policy: may this assistant read the calendar, with these arguments?
Hint

Permission checks sit between the proposal and the execution, never after the fact.

Writes come last and pass a human gate: reads inform, writes commit.

From the lesson

← All practice