Function Call Request
Server-initiated message requesting a function call, to be handled by either client or server
The Voice Agent server sends FunctionCallRequest to request a function call. The client_side flag determines whether the server executes the function or expects the client to.
Purpose
This message is used to trigger either a built-in server-side function or a custom function defined by the client.
- When
client_sideisfalse, the server will handle the function using built-in logic. - When
client_sideistrue, the client must handle the function and respond with aFunctionCallResponse. - The optional
thought_signaturefield may be present when using certain Gemini models that require an additional function call identifier. See Gemini Docs for details.
A request can arrive before the user’s turn is confirmed. See Turn confirmation below.
Handling the message
The client_side property is set by the server to indicate where the function should be executed.
When your client receives a FunctionCallRequest:
- Check the
client_sidefield. - If it’s
true, call the appropriate client-defined function. - Return a
FunctionCallResponsemessage with the function result. - If it’s
false, no client action is needed; the server will handle it internally.
Turn confirmation
The agent begins building a reply before speech-to-text confirms the user has finished speaking, so a FunctionCallRequest can reach you inside that speculative window. If the user keeps speaking, the turn resumes and the call is cancelled.
- By default, a call is dispatched as soon as the LLM emits it. You may receive a
FunctionCallCancelledfor it, in which case you should stop work on thatidand send no response. - To stop a function from being requested speculatively at all, set
defer_until_eottotrueon its definition inSettings. The request is then only sent once the turn is confirmed.
defer_until_eot is a Settings property, not a field on this message. Requests carry only the fields listed below.
For the behavior in full, see Speculative Replies & Turn Confirmation.
Example payloads
Client-side function
The server asks the client to execute get_weather and reply with a FunctionCallResponse.
The thought_signature field is optional. Certain Gemini models include it as an additional function call identifier. See Gemini Docs.
Server-side function
The server executes the function internally and notifies the client. The client takes no action.
Fields
Related messages
FunctionCallResponse: The expected response from the client whenclient_sideistrue.FunctionCallCancelled: Sent when a request you already received is cancelled because the user started speaking again, either inside the speculative window or after the turn was confirmed.