tool_calls
A structured field in a large model response that represents a request to invoke a tool. Each entry carries a call ID, the function name, and arguments formatted as JSON. The field is emitted as an alternative to text content, so a response contains either text or tool calls rather than both at once.
Timeline (last 90 days)
The tool call return structure of an OpenAI-style interface is located at choices[0].message.tool_calls, which is an array where each item contains three fields: id, type and function, among which function.arguments is a JSON string rather than an object.
In the tool-calling loop, assistant messages containing tool_calls must be passed back in the history verbatim and must not be rebuilt, otherwise the API cannot match them correctly.
What the model returns is not the function call itself but a tool_calls field containing the function name and parameters, which the application code parses and executes on its own.
All Facts (3)
The tool call return structure of an OpenAI-style interface is located at choices[0].message.tool_calls, which is an array where each item contains three fields: id, type and function, among which function.arguments is a JSON string rather than an object.
50%UnverifiedIn the tool-calling loop, assistant messages containing tool_calls must be passed back in the history verbatim and must not be rebuilt, otherwise the API cannot match them correctly.
50%UnverifiedWhat the model returns is not the function call itself but a tool_calls field containing the function name and parameters, which the application code parses and executes on its own.
50%