Tool use lets an assistant request external function calls rather than only generate text. The model selects a function and supplies arguments; a workflow executes the request and returns the result to the conversation. The request itself is not execution. section 3.1.6 section 6.0
A model request supplies tool definitions with a function name, description, and JSON Schema parameters. The response can contain text, tool calls, or both. Each call has an ID, a type, a function name, and JSON-encoded arguments. section 3.1.6 section 10.6
{
"role": "assistant",
"content": null,
"tool_calls": [{
"id": "call_abc123",
"type": "function",
"function": {
"name": "check_availability",
"arguments": "{\"date\": \"2024-01-16\"}"
}
}]
}
An assistant message requests an availability check through its tool_calls field; the arguments are encoded as a JSON string. section 4.1
A typical agent loop coordinates the model and the Tool Service:
- Discover registered tools and pass their model-ready definitions with the conversation. section 6.1.3 section 10.6
- Preserve the assistant message, parse each requested function's arguments, and execute the call through the Tool Service. section 2.1.5 section 10.6
- Append each result as a tool-role message with the matching tool call ID. The ID associates results with requests when multiple calls are made. section 4.1
- Send the updated conversation back to the model; repeat until it produces a final response or the workflow reaches its iteration limit. section 10.6
Checking appointment availability
A patient asks about openings. The assistant requests check_availability with a date; the workflow executes it and records available slots in a tool message linked to the call ID. The assistant then uses those slots in its answer. section 4.1
Production tool use requires more than a function schema. A registry supports discovery and reuse; credential references keep secrets out of application code. Authentication, parameter validation, rate limits, error recovery, and response formatting belong at the service boundary. section 2.1.5 section 6.0 section 1.4
Actions can change external state. Marking tools as read-only or non-idempotent informs guardrail decisions: repeating a calendar or ticket creation call can produce duplicate results. Limits and business policies help contain the consequences of repeated or inappropriate calls. section 6.0 section 10.6

















