In short.
This Pydantic AI guide shows Python developers how to describe tool results to a model, with delivery depending on the model's support for return schemas. IncludeToolReturnSchemas sends schemas through a structured API field where supported and otherwise embeds JSON text in tool descriptions. Two examples demonstrate configuration and expected request flags using TestModel. Real-provider behavior, compatibility with specific versions, costs and improvements in model responses are not established.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete selected page at [https://pydantic.dev/docs/ai/capabilities/include-tool-return-schemas/index.md]: the explanation, both Python examples, selection options and toolset alternative. The documentation-index and agent-query notices are site context, not capability setup requirements. Linked API references, the documentation index and toolset-composition pages are excluded. No code was executed, and real-provider behavior, performance, costs and response quality were not assessed.
The overview
Identity
Include Tool Return Schemas is a focused Pydantic AI documentation guide at [https://pydantic.dev/docs/ai/capabilities/include-tool-return-schemas/index.md]. It explains a capability that adds information about tool return types to tool definitions sent to a model.
Assessment
The guide provides concrete configuration for developers already building agents with Pydantic AI. Its useful distinction is how return schemas reach different models: a structured request field where supported, or JSON text in the tool description otherwise. It does not demonstrate whether either route improves model responses.
Users
The material suits Python developers who register functions as agent tools and want models to receive information about their results. Beginners need familiarity with function return annotations and Agent configuration. Experienced developers get selection options for applying the capability to particular tools.
Capabilities
IncludeToolReturnSchemas enables return-schema inclusion through the Agent capabilities parameter. Its tools parameter can select tools by a list of names, a metadata dictionary or a callable predicate: a function that decides which tools match. The examples show general configuration and selection by tool name; metadata and predicate examples are absent.
Using it
Requirements
The examples require Python and a Pydantic AI installation exposing Agent, IncludeToolReturnSchemas and TestModel. Minimum Python and package versions are unspecified. Provider credentials, installation commands and configuration for a real model are not described.
Mechanism
A return schema describes the expected form of a tool's result. The capability includes that schema in the tool definition sent to the model. The page names Google Gemini as an example of native support, where a structured API field carries the schema. Other models receive it as JSON text within the tool description.
The examples inspect the include_return_schema flag on tool definitions. They do not show a real provider's outgoing request or establish runtime validation of returned values.
Setup
Import Agent and IncludeToolReturnSchemas, then pass capabilities=[IncludeToolReturnSchemas()] when creating the agent. Register a function with @agent.tool_plain and a return annotation. To limit inclusion by name, use IncludeToolReturnSchemas(tools=['get_temperature']).
The supplied examples instantiate TestModel and pass it to Agent. They provide no version pin or real-provider setup.
Example
The first example registers get_temperature(city: str) -> float, which always returns 21.0. After prompting about Paris, its code inspects TestModel.last_model_request_parameters and asserts that the tool's include_return_schema flag is True. The function does not retrieve live weather.
The second example also registers get_greeting(name: str) -> str, but selects only get_temperature. Its assertions expect True for the temperature tool and None for the greeting tool. These are assertions supplied by the documentation; neither example was executed for this report.
Assessment & evidence
Limitations
The examples cover float and str return annotations. Handling of complex types, unsupported annotations and schema-generation errors is not described. There is no supported-model matrix or provider-version detail.
No real-model responses, latency measurements or accuracy comparisons are supplied. Providing a schema does not, on this evidence alone, establish that a model will interpret or follow it correctly.
Fit reasoning
The guide fits work where an existing Pydantic AI agent should expose tool-result structure to its model. Selective configuration gives developers control over which tools carry that information. Whether this helps a particular task remains unknown because the page demonstrates configuration flags rather than measured task outcomes.
Alternatives
The page says the same effect is available at the toolset level through .include_return_schemas(). This offers another configuration location within Pydantic AI. Its implementation details are on linked pages outside the supplied scope. Other frameworks and approaches are not compared.
Evidence
The evidence consists of the complete documentation page at [https://pydantic.dev/docs/ai/capabilities/include-tool-return-schemas/index.md], including its explanation and two Python examples. The page labels the examples runnable as supplied, but no execution results or real-provider request captures are available.
The captured source revision is sha256:0407ce313fb0c9773beda98cae7d069dfd7020263ca26729d14bb5f2af423c26. Linked documentation was not included.
Access & freshness
Costs
The page provides no pricing, token measurements or provider charges. The incremental cost of including return schemas is unknown. Neither the use of TestModel in the examples nor the described fallback establishes the cost of running a real-provider application.
Rights
No license or reuse terms appear in the supplied page. Permission to redistribute the documentation or reuse its example code is unknown from this evidence. The page also does not establish the library's license.
Freshness
The page was captured on 13 November 2026 at 19:24:51.410 UTC. It supplies no publication date, update date or applicable Pydantic AI version. Compatibility with a particular installed release or provider model version is therefore unknown.
Next steps
For adoption, first confirm that your installed Pydantic AI version exposes the capability. Use the supplied TestModel examples to inspect the expected flags, then evaluate your actual provider's request format and responses. Check representative return types and measure token usage before assuming a reliability or cost benefit.
