Built-in Tools
Swarmie registers its built-in tools in crates/tools/src/registry.rs via core_registry().
The current core registry includes 13 tools:
| Tool | Purpose | Key Parameters |
|---|---|---|
bash | Run shell commands in the workspace. | command (required), timeout, description |
read | Read file contents (text or image). | file_path (required), offset, limit |
glob | Find files by glob pattern. | pattern (required), path |
grep | Search file content by pattern. | pattern (required), path, output_mode, glob, type, -i, -A/-B/-C, -n, multiline, head_limit, offset |
write | Write/replace file contents. | file_path (required), content (required) |
edit | Replace a string in a file. | file_path, old_string, new_string (required), replace_all |
web_fetch | Fetch a URL and return content. | url (required), prompt |
web_search | Search the web. | query (required), allowed_domains, blocked_domains |
notebook_edit | Modify Jupyter notebook cells. | notebook_path, new_source (required), cell_number, cell_type, edit_mode |
patch | Apply unified diff patches. | patch (required), file_path |
file_search | Fuzzy filename search in workspace. | query (required), limit |
memory_write | Append project memory notes. | content (required), file |
undo | Revert the latest ghost snapshot. | rollout_path (required) |
Examples
Read a file segment
{"file_path":"/abs/path/src/main.rs","offset":120,"limit":80}Search text with context lines
{"pattern":"SwarmConfig","path":".","output_mode":"content","-C":2}Apply an edit
{"file_path":"/abs/path/src/lib.rs","old_string":"foo","new_string":"bar","replace_all":false}Fetch from the web
{"url":"https://example.com/docs","prompt":"Extract the API authentication section"}Notes
- Input validation happens per tool implementation in
crates/tools/src/*.rs. - Most filesystem tools require paths to stay within the current workspace root.
- Tool usage still goes through Swarmie's permission evaluator before execution.