Understand tool calling - Writer AI Studio

Tool calling

Tool calling allows you to call external tools that you define and integrate them into your agent’s responses. Instead of requiring you to build static, hardcoded workflows, tool calling enables you to build agents that dynamically choose and orchestrate the right combination of tools based on the specific context of each request. This document describes why tool calling matters and how it works behind the scenes. Jump to tool calling in Agent Builder to learn how to use tool calling in Agent Builder.

Why tool calling matters

Customer service example

A customer writes to your support team:

“I ordered two items last week but only received one and the item I got isn’t working.”

Your Agent Builder agent takes a customer’s request and uses tool calling to dynamically select the most relevant tools to use. Available tools might include:

Given the tools provided to the model, it can review the user’s request and automatically:

  1. Extract the customer ID from context
  2. Call get_order_details() to understand what was ordered
  3. Call check_shipping_status() for the missing item
  4. Look up return policies from your connected support Knowledge Graph
  5. Synthesize all this information into a coherent, helpful response

How tool calling works behind the scenes

While the AI model intelligently decides which tools to use and what parameters to call them with, the model doesn’t actually execute the tools itself. Instead, there’s a two-step handoff process:

The AI then uses the results of the tool calls to continue reasoning and provide the final response.

Project manager analogy

Think of it like a project manager coordinating subcontractors: The AI project manager understands the entire project scope and knows exactly which specialists to engage and what work needs to be done. When a customer has an issue, the AI says “I need the shipping contractor to check tracking #12345, then the inventory contractor to verify stock levels.” But the AI doesn’t do the actual work; each subcontractor (your systems) has their own expertise and tools to execute their piece, then reports back to the project manager who coordinates everything into the final deliverable. This architecture provides several benefits:

Next steps

Now that you understand why tool calling matters and how it works behind the scenes, learn how to use tool calling in Agent Builder.