Skip to main content

Agent Properties

Configure tool behavior using these properties in your agent class:
Set $parallelToolCalls to null or remove it to remove parameter from the request entirely. Some models like o1 don’t support parallel tool calls.

Tool Choice

Control how the LLM selects and uses tools for each request.

Available Modes

Runtime Methods

toolRequired() and forceTool() only apply to the first LLM call. After that, tool choice automatically switches to auto to prevent infinite loops.
forceTool() requires the tool’s name as a parameter, not the method or class name.

Parallel Tool Calls

When enabled, the LLM can request multiple tool calls in a single response, which LarAgent executes together before continuing.
At runtime:

Runtime Tool Management

Add or remove tools dynamically during execution.

Adding Tools

Removing Tools

Conditional Tools

Register tools based on runtime conditions:

Next Steps

Phantom Tools

Tools that return control to your application for external handling.

Attribute Tools

Create tools using the #[Tool] attribute.

Tool Classes & Inline

Build reusable tool classes or create tools dynamically.