Back

Function calling

Declare function tools and return their results in the supported canonical conversation format.

Tools

Use type: function with a name, description and JSON-schema parameters. The application owns validation and execution; the gateway does not execute your function.

Streaming arguments

Accumulate tool arguments by call index. Execute only after a valid terminal tool_calls result, never while JSON is incomplete.

Compatibility

Text/function tools are supported by selected adapters. Gemini function tools, rich media and signed thinking history are not generally supported. Unsupported parameters are rejected.

{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "read_note",
        "parameters": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ]
        }
      }
    }
  ]
}

Open workspace