Gemini Function Calling: Verify Actions, Not Just Requests

A user asks about order A-104 and Gemini says it is checking. That can look like progress on screen, but the app still has work to do before the order status is known.

Request card for passing through the inspection gate to the operating mechanism and result receipt. It refers to separating AI requests from actions.

A function-call request is not an order status

In this hypothetical example, a user asks, “Where is order A-104?” Gemini might choose a function name and arguments as described in Google's function-calling documentation as follows:

get_order_status({"order_id":"A-104"})

This text does not show that a database was queried or that a “shipping” status came back. The app must check the format of A-104 and the user's permissions, call the order service, and pass the actual status to the model. Without a result from that service, the status remains unconfirmed.

There is an exception concerning who performs the call: The GenerateContent Python SDK can loop through automatic function calls. A code example without a visible loop may still execute a function. Functions exposed to the SDK still need their own input and authorization checks. This article concerns application functions, not every provider-run tool.

Trace the request through four points

  1. The app declares the function name, purpose and allowed argument types to the model.
  2. The model proposes a function and arguments it considers relevant to the question.
  3. The app checks the input, scope, permissions and consequences before calling an API.
  4. The app returns only the necessary API result, distinguishing success, failure and uncertainty.

This is a conceptual sequence, not a ready-to-use API payload. A response may contain several function calls or a sequence of them. Check each request. Payments, email, deletion and permission changes should require user confirmation and an auditable record. A schema does not prove that the account owner authorized an action.

When an API goes quiet, do not guess that an action succeeded

ScenarioInformation that the system should returnappropriate answer
Code not foundnot_foundThis item was not found. Please check the code.
Timed outtimeoutStill can't confirm status. It shouldn't be said that it was successful.
Not authorizedforbiddenCannot access this data with current permissions
SuccessStatus from the live systemStatus report with reference time

The table separates the status the app gives the model from what it should tell the user. For a write operation, plan for retries: use a unique request ID and inspect the database result before retrying to reduce duplicate actions.

Suppose a user asks to cancel A-104 and the API times out. The cancellation might have succeeded with a lost response, or it might never have happened. KrobClick's suggested design is to keep the request ID, check the downstream status before retrying, and say “not yet confirmed” if the result is still unknown. Do not blindly repeat the request.

Response matching and authorization are separate checks

Google's function-response guidance says some API formats require matching call IDs, function names and the number of responses to the model's requests. Do not read only the last part and assume there was a single call. Check requirements for your model ID and SDK. This is based on documentation, not a KrobClick API test; use a test account, hypothetical data and restricted permissions before connecting production.

Signing in establishes identity, not permission to read someone else's order. A customer ID supplied by the model is not proof of authorization. Treat text from APIs and external documents as data, not instructions to expand tool permissions. For result structure, see JSON syntax, schema and meaning; for service credentials, see keeping an API key out of the browser

Which cases should you test before connecting a real system?

Test success alongside insufficient permissions, unknown IDs, timeouts and repeated requests. Compare displayed messages with downstream records before telling users what actually happened.

Read moreHow to inspect AI Agent work?Separate reported status from evidence the destination system worked

Sources

Google documentation reviewed October 16, 2026, Thailand time. Order IDs and statuses are hypothetical; no actual API test was performed.