MatryoshkaToolInjectionStrategy

Injection strategy that handles MatryoshkaTool invocations.

When a MatryoshkaTool is invoked:

  1. Its selected inner tools are added to the available tools

  2. 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:

  1. LLM sees: "database_operations" tool

  2. LLM invokes: database_operations

  3. Result: database_operations removed, query_table/insert/update/delete added

  4. LLM can now use specific database tools

This strategy can be combined with other strategies using ChainedToolInjectionStrategy.

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Called after each tool execution to determine tool changes.

Link copied to clipboard

Legacy method for backward compatibility. Override evaluate instead for new implementations.