Executes agent tools through the registry with approval checking, context validation, and Config.Advice integration.
Summary
Types
Execution mode: :exec allows all tools, :plan refuses destructive tools before approval.
Result of tool execution.
Functions
Executes a tool by name with the given arguments.
Executes a tool that has already been approved by the user.
Executes an approved tool with opts such as :tool_context.
Types
@type execution_mode() :: :exec | :plan
Execution mode: :exec allows all tools, :plan refuses destructive tools before approval.
@type hook_runner() :: (MingaAgent.Hooks.Hook.t(), MingaAgent.Hooks.PreToolUsePayload.t() -> MingaAgent.Hooks.Result.t())
@type result() :: {:ok, term()} | {:error, term()} | {:needs_approval, MingaAgent.Tool.Spec.t(), map()}
Result of tool execution.
Functions
Executes a tool by name with the given arguments.
@spec execute(String.t(), map(), atom(), execution_mode()) :: result()
@spec execute_approved(MingaAgent.Tool.Spec.t(), map()) :: {:ok, term()} | {:error, term()}
Executes a tool that has already been approved by the user.
@spec execute_approved(MingaAgent.Tool.Spec.t(), map(), keyword()) :: {:ok, term()} | {:error, term()}
@spec execute_approved(MingaAgent.Tool.Spec.t(), map(), execution_mode()) :: {:ok, term()} | {:error, term()}
Executes an approved tool with opts such as :tool_context.