Matryoshka Tool Injection Strategy
Injection strategy that handles MatryoshkaTool invocations.
When a MatryoshkaTool is invoked:
Its selected inner tools are added to the available tools
If MatryoshkaTool.removeOnInvoke is true, the facade is removed
This enables progressive tool disclosure - presenting simplified categories initially, then revealing granular tools when the LLM expresses intent.
Example flow:
LLM sees: "database_operations" tool
LLM invokes: database_operations
Result: database_operations removed, query_table/insert/update/delete added
LLM can now use specific database tools
This strategy can be combined with other strategies using ChainedToolInjectionStrategy.
See also
Functions
Called after each tool execution to determine tool changes.
Legacy method for backward compatibility. Override evaluate instead for new implementations.