Function Call Request

Server-initiated message requesting a function call, to be handled by either client or server

Voice Agent

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_side is false, the server will handle the function using built-in logic.
  • When client_side is true, the client must handle the function and respond with a FunctionCallResponse.
  • The optional thought_signature field may be present when using certain Gemini models that require an additional function call identifier. See Gemini Docs for details.

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:

  1. Check the client_side field.
  2. If it’s true, call the appropriate client-defined function.
  3. Return a FunctionCallResponse message with the function result.
  4. If it’s false, no client action is needed; the server will handle it internally.

Example payloads

Client-side function

The server asks the client to execute get_weather and reply with a FunctionCallResponse.

1{
2 "type": "FunctionCallRequest",
3 "functions": [
4 {
5 "id": "fc_12345678-90ab-cdef-1234-567890abcdef",
6 "name": "get_weather",
7 "arguments": "{\"location\": \"Fremont, CA 94539\"}",
8 "client_side": true,
9 "thought_signature": "abc123"
10 }
11 ]
12}

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.

1{
2 "type": "FunctionCallRequest",
3 "functions": [
4 {
5 "id": "fc_aabbccdd-eeff-0011-2233-445566778899",
6 "name": "end_call",
7 "arguments": "{\"reason\": \"completed\"}",
8 "client_side": false
9 }
10 ]
11}

Fields

FieldTypeDescription
typestringAlways "FunctionCallRequest".
functions[].idstringUnique identifier for this function call. Echo back in the FunctionCallResponse.
functions[].namestringFunction name as defined in your agent configuration.
functions[].argumentsstringJSON-encoded arguments. Parse before passing to the function.
functions[].client_sidebooleantrue if the client must execute and respond. false if the server handles it.
functions[].thought_signaturestringOptional. Used by some Gemini models. Pass back unchanged in the response when present.