Definition

interface Definition

Framework-agnostic tool definition.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val description: String

Description explaining what the tool does. Critical for LLM to choose correctly.

Link copied to clipboard

Schema describing the input parameters.

Link copied to clipboard
open val metadata: Map<String, Any>

Extensible key-value metadata for application-level concerns (routing, categorization, feature flags, etc.). Not sent to the LLM — used by the tool framework and hosting application.

Link copied to clipboard
abstract val name: String

Unique name for the tool. Used by LLM to invoke it.

Functions

Link copied to clipboard
open fun withMetadata(entries: Map<String, Any>): Tool.Definition

Return a copy of this definition with the given metadata entries merged in. Existing keys are overwritten by the new values.

open fun withMetadata(key: String, value: Any): Tool.Definition

Return a copy of this definition with a single metadata entry added.

Link copied to clipboard