Source-owned declaration for an agent tool.
A spec describes a tool and how to build its executable callback for a session. It does not own session state, credentials, approval decisions, events, or cleanup. Context-sensitive tools declare their requirements and receive a core-built MingaAgent.Tool.Context only when the executor has one.
Summary
Types
Approval level for tool execution.
Builds an executable callback from a runtime context.
Executable provider-facing callback.
Capability advertised by a tool declaration.
Tool category for grouping and filtering.
Runtime context required before a tool can be built.
Source that contributed this tool.
A tool specification.
Functions
Builds an executable callback for the given runtime context.
Creates a new tool spec from a keyword list or map.
Creates a new tool spec, raising on validation failure.
Types
@type approval_level() :: :auto | :ask | :deny
Approval level for tool execution.
Builds an executable callback from a runtime context.
Executable provider-facing callback.
@type capability() :: :read_project | :mutate_project | :run_shell | :network | :git_read | :git_mutate | :lsp_read | :lsp_mutate | :memory_write | :spawn_agent | atom()
Capability advertised by a tool declaration.
@type category() ::
:filesystem | :git | :lsp | :shell | :memory | :agent | :network | :custom
Tool category for grouping and filtering.
@type context_requirement() :: :tool_context | :router | :project_root | :parent_session | atom()
Runtime context required before a tool can be built.
@type source() :: :builtin | :config | {:bundle, :read_only_tools} | {:bundle, :lsp_tools} | {:extension, atom()}
Source that contributed this tool.
@type t() :: %MingaAgent.Tool.Spec{ approval_level: approval_level(), build: build_fun(), callback: callback() | nil, capabilities: [capability()], category: category(), context_requirements: [context_requirement()], description: String.t(), metadata: map(), name: String.t(), parameter_schema: map(), source: source() }
A tool specification.
Functions
Builds an executable callback for the given runtime context.
Creates a new tool spec from a keyword list or map.
Creates a new tool spec, raising on validation failure.