Tool definitions for the native agent provider.
Each tool is a ReqLLM.Tool struct with a name, description, JSON Schema
parameters, and a callback that executes the operation. Tools are scoped
to the project root directory for safety: file operations refuse to escape
the project boundary.
Available tools
| Tool | Description |
|---|---|
read_file | Read file contents (supports offset/limit for slices) |
write_file | Write content to a file (creates or overwrites) |
edit_file | Replace exact text in a file |
multi_edit_file | Apply multiple edits to one file in a single call |
apply_diff | Apply a unified diff to one file |
delete_file | Delete a file |
list_directory | List files and directories at a path |
find | Find files by name/glob pattern |
grep | Search file contents for a pattern |
fetch_url | Fetch a URL and return readable text content |
shell | Run a shell command in the project root |
git_status | Show changed files with structured status (read-only) |
git_diff | Show unified diff for files or all changes (read-only) |
git_log | Show recent commits with structured output (read-only) |
git_stage | Stage files for commit (destructive) |
git_commit | Create a commit with a message (destructive) |
memory_write | Save a learning or preference to persistent memory |
diagnostics | Get current LSP diagnostics for a file (read-only) |
definition | Find where a symbol is defined via LSP (read-only) |
references | Find all usages of a symbol via LSP (read-only) |
hover | Get type info and docs for a symbol via LSP (read-only) |
document_symbols | List all symbols in a file via LSP (read-only) |
workspace_symbols | Search for symbols project-wide via LSP (read-only) |
rename | Semantic rename across the project via LSP (destructive) |
code_actions | List/apply LSP code actions (apply is destructive) |
describe_runtime | Describe the runtime's capabilities and features |
describe_tools | List all available tools with descriptions |
Summary
Functions
Returns all available tools scoped to the given project root.
Returns all core built-in tool names.
Returns source-owned built-in tool declarations.
Returns true if the named tool is classified as destructive.
Returns the file/project read tool subset for constrained rewrite sessions.
Returns true when the tool name is allowed in constrained file-read sessions.
Returns the read-only tool subset for ephemeral inline ask sessions.
Returns true when the tool name is allowed in read-only sessions.
Resolves a relative path against the project root and validates that the resolved path does not escape the root directory.
Types
@type tools_opts() :: [ project_root: String.t(), project_view: MingaAgent.ProjectView.t() | nil, changeset: pid() | nil, fork_store: pid() | nil, parent_session: GenServer.server() | nil, shell_output_callback: (String.t() -> :ok) | nil ]
Options passed to all/1.
Functions
@spec all(tools_opts()) :: [ReqLLM.Tool.t()]
Returns all available tools scoped to the given project root.
The project_root is baked into each tool's callback closure so that every
file operation is sandboxed to that directory tree.
@spec builtin_names() :: [String.t()]
Returns all core built-in tool names.
@spec builtin_specs() :: [MingaAgent.Tool.Spec.t()]
Returns source-owned built-in tool declarations.
Returns true if the named tool is classified as destructive.
Reads the configured list from :agent_destructive_tools. Accepts an
optional list override for testing without starting the Options agent.
Some tools have conditional destructiveness based on their arguments.
Pass the tool arguments map to check parameter-dependent cases like
code_actions with apply set.
@spec file_read(tools_opts()) :: [ReqLLM.Tool.t()]
Returns the file/project read tool subset for constrained rewrite sessions.
@spec file_read_name?(ReqLLM.Tool.t() | String.t()) :: boolean()
Returns true when the tool name is allowed in constrained file-read sessions.
@spec read_only(tools_opts()) :: [ReqLLM.Tool.t()]
Returns the read-only tool subset for ephemeral inline ask sessions.
@spec read_only_name?(ReqLLM.Tool.t() | String.t()) :: boolean()
Returns true when the tool name is allowed in read-only sessions.
Resolves a relative path against the project root and validates that the resolved path does not escape the root directory.
Raises ArgumentError if the path escapes the project root.