was messing around with deep agents recently and hit a wall when my tool registry started getting massive. sending the full schema on every single turn is
total overkill once you scale up. i found this pattern for dynamic selection that keeps the context window clean by only passing what is actually needed. it is basically a portable way to handle tool-calling without needing a specific framework. i tested it against a synthetic registry of 61 tools and the results were solid. agent_loop. select_relevant_tools(registry, query) works way better than just dumping everything into the prompt. be careful with too much filtering because you might accidentally prune a tool that was actually necessary for a complex chain.
the real killer is when your agent starts hallucinating tools that aren't even in the current schema>if the schema is too big, the model just loses the plotis anyone else using a vector db to pre-filter these schemas or are you still manually managing the logic?
found this here:
https://dzone.com/articles/dynamic-tool-selection