Companion

Companion object that extends UnfoldingTool.Factory to provide factory methods. All factory methods from UnfoldingTool are available.

Example:

val tool = MatryoshkaTool.of(
name = "spotify_search",
description = "Search Spotify for music data",
innerTools = listOf(vectorSearchTool, textSearchTool)
)

Functions

Link copied to clipboard
open fun byCategory(name: String, description: String, toolsByCategory: Map<String, List<Tool>>, categoryParameter: String = "category", removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null): UnfoldingTool

Create an UnfoldingTool with category-based selection.

Link copied to clipboard
open fun fromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): UnfoldingTool

Create an UnfoldingTool from an instance annotated with @MatryoshkaTools.

Link copied to clipboard
open fun of(name: String, description: String, innerTools: List<Tool>, removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null): UnfoldingTool

Create an UnfoldingTool that exposes all inner tools when invoked.

Link copied to clipboard
open fun safelyFromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): UnfoldingTool?

Safely create an UnfoldingTool from an instance. Returns null if the class is not annotated with @MatryoshkaTools or has no @LlmTool methods.

Link copied to clipboard
open fun selectable(name: String, description: String, innerTools: List<Tool>, inputSchema: Tool.InputSchema, removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null, selector: (String) -> List<Tool>): UnfoldingTool

Create an UnfoldingTool with a custom tool selector.