Skip to main content
A function tool describes work your application can perform. The model chooses a function and supplies arguments; your application validates them, runs the function, and returns the result. Unlike a hosted tool or an MCP connection, declaring a function does not execute application code on the platform.

Describe the function

Include a tool definition in a Responses request. Use a focused name and a JSON Schema for its arguments:
Tool definition
This is the tools entry, not a complete request. Keep the model, input, and any conversation settings in the enclosing Responses request.

Handle a function call

Inspect the response output for function_call items. Each item identifies the function, JSON-encoded arguments, and a call_id. Before executing a call:
  1. Check the function name against the functions your application supports.
  2. Parse and validate the arguments.
  3. Check the authenticated user’s permission to perform the operation.
  4. Execute the operation and collect its result.
Model-generated arguments are input to your application, not authorization to bypass its access checks.

Return the result

Send a function_call_output item using the matching call ID, and continue from the preceding response:
Continuation payload
The model can answer or request more tools. Handle each requested call and continue until you receive the final answer. Bound the number of iterations and handle errors explicitly.

Complete workflows

  • Subagents implements the full loop, including multiple function calls and results.
  • Deep research applies that pattern to research tasks.
  • MCP tools lets MKA1 call an external tool server directly.