In short.
This Pydantic AI guide helps Python developers connect live AI assistants to backend actions, but providers behave differently and approval requests need handling during the conversation. It explains function and native tools, concurrent execution, errors, queued messages, session shutdown and delegation for structured results. The examples were not executed; runtime behavior, costs and reuse permissions remain unverified or unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete selected documentation page at [https://pydantic.dev/docs/ai/realtime/tools/index.md], including its opening documentation-index and agent-query notices, examples, table and edge cases. Linked destinations are excluded, including the documentation index, API references, provider pages, deployment guidance and issue discussions. All behavior is described from the captured text; nothing was executed. The page supplies no licence notice or separate library file supporting redistribution.
The overview
identity
Tools is a page in Pydantic AI's realtime documentation at [https://pydantic.dev/docs/ai/realtime/tools/index.md]. It explains how tools registered on an agent participate in a continuing AI conversation, including backend execution, provider responses and conversation history.
The resource is an implementation guide with Python examples. Its scope includes function tools, provider-native tools, approvals, queued messages, ending a session and delegating work to another agent.
assessment
The guide is useful when the difficult part is coordinating tools during an active conversation. It explains details that affect application behavior: whether the assistant keeps talking, when several tool results produce an answer, how failures reach application code and what happens while approval is pending.
It offers specific implementation guidance, but does not establish deployment readiness, measured latency, reliability or a complete installation path. Its strongest fit is as a focused reference alongside the rest of Pydantic AI's realtime documentation.
users
The examples suit Python developers building live voice or text assistants that look up information, perform backend actions or consult another agent. Customer support, order lookup and approval-controlled actions are illustrated use cases.
Beginners will need familiarity with asynchronous Python, decorators and event streams to follow the examples comfortably. Experienced developers get more value from the precise cancellation, exception, history and provider-support rules. The page does not provide a complete microphone, browser or approval interface.
capabilities
The documented session validates function arguments, supports retry responses, executes backend tools concurrently and records tool calls and results for later handoff. ToolReturn can attach supported multimodal content while local history retains structured values, content and metadata.
Provider-native tools run on the provider's servers and can be added through capabilities such as WebSearch, WebFetch or NativeTool. Other covered capabilities include restricting available functions, handling approval-required calls, queuing follow-up messages, ending a call from a tool and invoking a standard agent for structured results.
Using it
requirements
The examples require Python code using pydantic_ai, a compatible realtime model and an application backend for function tools. The page does not specify Python or package versions, installation commands, credential configuration or account requirements.
Native tools must match the model's supported_native_tools profile or have a configured local fallback. Approval-required and deferred calls need a HandleDeferredToolCalls handler. Restricting an ElevenLabs hosted agent's tools additionally requires its Tool IDs override to be enabled.
mechanism
Function calls produce FunctionToolCallEvent and FunctionToolResultEvent events. Tools run in background tasks so a slow function does not block session events or other tools. Results are returned as they finish, but when one response calls several tools, the model is asked to answer after all those results arrive. Stored history keeps each result beside its call.
The model's async_tool_call_mode determines whether conversation continues during execution. Models marked always keep talking, optional models do so when async_tool_calls=True, and never models wait. The shared setting has no effect on always or never models.
Parse failures and ModelRetry produce retried outcomes; ToolFailed supplies a failed result with its own message. Other unhandled exceptions send a generic error to the model and also propagate to application code. A consumer that catches a receive-stream exception and resumes iteration can keep the session working. UsageLimitExceeded sends no tool result to the model.
setup
The illustrated sequence is to create an Agent, register functions with agent.tool or agent.tool_plain, configure any capabilities and settings, then open agent.realtime(...).session() in an asynchronous context. Application code can send messages and consume session events.
For approval-controlled tools, declare requires_approval=True and attach HandleDeferredToolCalls(handler=...). The handler must resolve the request during the session, potentially by awaiting a person through an application interface. The guide advises instructing assistants that keep talking to wait for the result before confirming completion.
example
The refund example registers issue_refund(order_id, amount) as approval-required. A handler approves amounts up to $100 and denies larger amounts with ToolDenied. The function body only returns a formatted refund message; actual payment processing is not shown.
A separate example exposes a consult tool that calls a standard Agent with output_type=Answer, where Answer contains summary and confidence fields. The tool returns the summary string to the voice assistant. This illustrates obtaining a structured result in the delegated agent while passing only its summary into the live conversation.
Assessment & evidence
limitations
Tool choice is fixed when the session is created. Auto, none and a ToolOrOutput allow-list are supported, but choices that force a call, including required or a list of tool names, raise UserError before connection. Native-tool support depends on the model; unsupported tools require a local fallback or session opening fails.
A live session cannot pause and return DeferredToolRequests for later resumption. Without a resolving handler, deferred calls are refused and approval-required tools do not run. Tools registered with defer_loading=True are rejected.
Queued messages support text and SystemPromptPart; model-response objects are rejected and multimodal queue routing is not implemented in the documented behavior. Unsupported tool-return media raises UserError before sending. Provider cancellation cancels the local task and records a synthetic result without sending that result back.
reasoning
The central design tradeoff is conversational continuity while work remains unfinished. A model that keeps speaking can fill a slow lookup or approval wait, but may prematurely claim completion. A waiting model can produce silence; the page says user speech during a Gemini approval wait can cancel the pending call.
The guide also notes that very fast tools can make asynchronous Gemini calling counterproductive because a result may interrupt speech that just started. Its recommendation to delegate complex work or structured output to a standard agent is architectural guidance; no comparative accuracy or latency benchmarks are supplied.
alternatives
The documented alternative for approvals that must pause execution and resume later is a standard Pydantic AI agent run. A standard Agent with output_type can also supply structured results through a realtime tool.
Within a realtime session, enqueue waits for the active response to finish, while send delivers immediately. For shutdown, hang_up also ends the browser call on a WebRTC sideband; close leaves that browser call up. Comparisons with other agent frameworks are not supported by this page.
evidence
The evidence is the complete Tools documentation page from [https://pydantic.dev/docs/ai/realtime/tools/index.md]. It contains explanatory text, Python snippets and a model-behavior table. These support descriptions of the documented interfaces and constraints.
No code, session or provider integration was executed. Runtime correctness, model availability, latency and recovery behavior were not independently assessed. Linked API references, provider documentation and issue discussions are outside the supplied evidence.
Access & freshness
costs
The page provides no package pricing, provider tariffs, quotas or total operating costs. Costs are unknown, including any costs associated with provider-native tools and delegated agent calls. The refund example's $100 threshold is an approval condition, not a resource price.
rights
The supplied page states no licence or reuse terms for its documentation or code examples. Permission to copy, modify or redistribute them is unknown from this evidence. No separately downloadable library file is supplied within the selected page.
freshness
The page was captured on 26 November 2026 at 01:15:40.306 UTC. It supplies no explicit publication date, update date or Pydantic AI package release version.
Model identifiers, support tables and limitations describe the captured documentation. Their current availability and the status of linked issues are unknown beyond that capture.
actions
For a first implementation, choose a supported realtime model, register one backend tool and inspect FunctionToolCallEvent, FunctionToolResultEvent and RealtimeTurnCompleteEvent. Check the model's async_tool_call_mode and supported_native_tools before relying on continued speech or native capabilities.
Evaluate slow calls, approval denial, cancellation, exception handling and settled history before adding more actions. Use a standard agent run when approval must resume later, or delegate through a tool when structured results are needed. Installation details, model access, costs and reuse terms require information beyond this page.
