Skip to main content
The Responses API supports comprehensive tool calling capabilities, allowing models to call functions, execute tools in parallel, and handle complex multi-step workflows.
Stateless APIRemember that this API is stateless. When handling multi-turn tool calls, you must include the complete conversation history (including previous tool calls and results) in each request.

Basic Tool Definition

Define tools using the OpenAI function calling format:

Tool Choice Options

Control when and how tools are called using the tool_choice parameter: Force Specific Tool:

Handling Tool Calls

When a model calls a tool, the response contains function call information in the output:

Multi-Turn Tool Calling

Stateless DesignSince the Anannas API is stateless, you must include the complete conversation history in each request, including all previous tool calls and their results. The Anannas API does not remember previous tool interactions.
For multi-turn conversations with tool calls, include the tool results in subsequent requests:

Parallel Tool Calls

Enable parallel tool execution with parallel_tool_calls:

Best Practices

  1. Clear tool descriptions: Provide detailed descriptions for better tool selection
  2. Validate tool results: Always validate and sanitize tool execution results
  3. Handle errors gracefully: Implement error handling for tool execution failures
  4. Use parallel calls: Enable parallel_tool_calls when multiple independent tools can run simultaneously
  5. Tool result format: Return tool results as JSON strings for consistency
Was this page helpful?