Tool

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Tool(val name: String = "", val description: String = "", val requireConfirmation: Boolean = false, val isLongRunning: Boolean = false)

Annotates a function to be exposed as an executable tool by the Google ADK Kotlin. KSP will generate a corresponding com.google.adk.kt.tools.FunctionTool wrapper for annotated functions.

Note: this annotation shares its simple name with com.google.adk.kt.types.Tool, the GenAI tool definition data class. Files that need to reference both should use an import alias.

Properties

Link copied to clipboard

An optional explicit description. If not provided, the KDoc summary is used.

Link copied to clipboard
val isLongRunning: Boolean = false

If true, indicates the tool returns a Pending state and resumes later.

Link copied to clipboard

An optional explicit name for the tool. If not provided, the function name is used.

Link copied to clipboard

If true, the tool execution requires user confirmation.