Besides standard Pydantic features, you can also use a special ToolConfig class to customize tool behavior within the framework:

Available ToolConfig Parameters

The following parameters are supported, with version compatibility noted:
NameTypeVersionDescriptionWhen to UseDefault Value
one_call_at_a_timeboolAllPrevents concurrent execution for a specific tool. In v1.x the Agent-level parallel_tool_calls parameter is deprecated (still accepted and forwarded to ModelSettings). Prefer configuring via model_settings=ModelSettings(parallel_tool_calls=...). Use this per-tool setting when you need strict sequencing.Use for database operations, API calls with rate limits, or actions that depend on previous results.False
strictboolAllEnables strict mode, which ensures the agent will always provide perfect tool inputs that 100% match your schema. Has limitations. See OpenAI Docs.Use for mission-critical tools or tools that have nested Pydantic model schemas.False
async_modestrv0.xWhen set to “threading,” executes this tool in a separate thread. Deprecated: Tools are now always async in v1.xUse when your agent needs to execute multiple tools or the same tool multiple times in a single message to decrease latency. Beware of resource allocation.None
output_as_resultboolv0.xForces the output of this tool as the final message from the agent that called it. Deprecated: No longer supported in v1.x. Use agent’s tool_use_behavior parameter instead.Only recommended for very specific use cases and only if you know what you’re doing.False
Version Changes:
  • v1.x: async_mode and output_as_result parameters have been removed as tools are now always asynchronous and tool output handling moved into the Agent/ModelSettings layer. The v0.x top-level Agent parameter parallel_tool_calls is deprecated in v1.x (still accepted and forwarded to ModelSettings); prefer configuring Agent-level parallelism via model_settings=ModelSettings(parallel_tool_calls=...) and/or per-tool one_call_at_a_time.

Usage

To use one of the available parameters, simply add a class ToolConfig block to your tool class:
class MyCustomTool(BaseTool):
    # ...

    class ToolConfig:
        one_call_at_a_time = True
        strict = False
        async_mode = "threading"  # Deprecated in v1.x and newer
        output_as_result = True   # Deprecated in v1.x and newer

    def run(self):
        # ...