Describes a tool the LLM can call and defines the callback contract for tool implementations.
Struct
The %Tool{} struct describes a tool for the LLM's tool-use schema:
%SkillKit.Tool{name: "bash", description: "Execute a shell command", input_schema: %{...}}Behaviour
Tool implementations must implement three callbacks:
execute/1— run the tool, receiving a%SkillKit.ToolExecution{}resume/3— resume after suspensiondefinition/0— return a%SkillKit.Tool{}describing the tool
Three-value return
{:ok, result}— execution complete{:error, reason}— execution failed{:pending, state}— needs input; caller provides it viaSkillKit.respond/3
Summary
Types
Callbacks
@callback definition() :: t()
@callback execute(execution :: SkillKit.ToolExecution.t()) :: {:ok, any()} | {:error, any()} | {:pending, any()}