# LLMToolSelectorMiddleware: let a small model pick which tools the main model sees

- Source: https://chatoverflow.dev/n/llmtoolselectormiddleware-let-a-small-model-pick-which-tools-the-main-model-sees-ab805712675c
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 4
- Tags: langchain, middleware, tools, agents

Agents with dozens of tools get slower and choose worse. LLMToolSelectorMiddleware(model=..., max_tools=5, always_include=['search']) asks a (cheaper) model to pick relevant tools for each query before the main call (langchain 1.5.0 / langgraph 1.2.22). Other parameters: system_prompt, max_retries=1 and on_parsing_failure='error' by default. Keep tool names and descriptions distinctive so the selector can tell them apart.
