Orchestrates the request
Backend & Runtime / Knowledge library
Tool-Calling Agents
AI agents using tools to fetch data, run code and call APIs
Why learn Tool-Calling Agents?
Useful for workflows where language alone is insufficient and the AI system must inspect, retrieve, compute or act.
Where it came from
Tool-calling agents combine model reasoning with external actions such as web search, file search, code execution or custom functions.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Summarize the official positioning for Tool-Calling Agents in one paragraph.
- Identify the buyer, developer, or user workflow Tool-Calling Agents is built for.
- Compare Tool-Calling Agents with a neighboring catalog topic and name the boundary.
- List two implementation risks or adoption questions for Tool-Calling Agents.
- Design a five-question evaluation that would test whether someone understands Tool-Calling Agents.
Documentation and sources
- OpenAI Agents SDK tools docs (openai.github.io)
Catalog research notes
- Research snapshot: September 20, 2026. This entry summarizes the linked public documentation and should be refreshed before making version-specific claims.
Connect the ideas
Built on
Enables
Explore next
Real World Example
Automated Logistics Inventory Reconciliation
Logistics companies managing high-volume warehouse inventory across distributed regional hubs.
The business problem
Manual inventory reconciliation is slow and error-prone, leading to stock discrepancies and delayed order fulfillment.
How this topic solves it
Implementing an agent with Programmatic Tool Calling allows the model to execute complex, multi-step inventory checks in a single hosted V8 environment, reducing round-trip latency.
- Define a Pydantic model for inventory output to ensure strict schema validation.
- Create a FunctionTool to fetch real-time stock levels from the warehouse database.
- Configure an Agent with ProgrammaticToolCallingTool and set model_settings to programmatic_tool_calling.
- Implement the agent to summarize inventory data across multiple SKUs using the programmatic execution environment.
Shows how the agent orchestrates inventory tasks via a programmatic environment.
Hosted V8 execution environment
Function tool fetching data
Pydantic schema for validation
- Agent → delegates logic → ProgrammaticToolCallingTool
- ProgrammaticToolCallingTool → invokes → get_inventory
- get_inventory → validates output → InventoryOutput
Implementation example
This code sets up the agent to use the programmatic tool calling feature, allowing the model to execute the get_stock function within a hosted environment.
from agents import Agent, ProgrammaticToolCallingTool, ModelSettings
# Define tool with allowed_callers to enable programmatic access
@tool(allowed_callers=["programmatic"])
def get_stock(sku: str) -> int:
return 100 # Mock database lookup
agent = Agent(
name="InventoryAgent",
model_settings=ModelSettings(tool_choice="programmatic_tool_calling"),
tools=[get_stock, ProgrammaticToolCallingTool()]
)Expected business outcome
Faster, consistent inventory reporting without requiring constant model-to-client communication for every sub-task.
Limitations and checks
Programmatic Tool Calling disables provider-managed retries, requiring developers to implement robust error handling within the tool logic to manage potential execution failures.