Configuration options for the middleware
The language model to use for tool selection (default: the provided model from the agent options).
Instructions for the selection model.
Maximum number of tools to select. If the model selects more, only the first maxTools will be used. No limit if not specified.
Tool names to always include regardless of selection. These do not count against the maxTools limit.
Middleware for selecting tools using an LLM-based strategy.
When an agent has many tools available, this middleware filters them down to only the most relevant ones for the user's query. This reduces token usage and helps the main model focus on the right tools.