Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Built-in Tools

Swarmie registers its built-in tools in crates/tools/src/registry.rs via core_registry().

core_registry() is the portable baseline. Runtime-specific tools (for example orchestration tools like branch, and CLI runtime tooling like cron) are registered in higher layers, not in core_registry() itself.

The current core registry includes 15 tools:

ToolPurposeKey Parameters
bashRun shell commands in the workspace.command (required), timeout, description
readRead file contents (text or image).file_path (required), offset, limit
globFind files by glob pattern.pattern (required), path
grepSearch file content by pattern.pattern (required), path, output_mode, glob, type, -i, -A/-B/-C, -n, multiline, head_limit, offset
writeWrite/replace file contents.file_path (required), content (required)
editReplace a string in a file.file_path, old_string, new_string (required), replace_all
web_fetchFetch a URL and return content.url (required), prompt
web_searchSearch the web.query (required), allowed_domains, blocked_domains
notebook_editModify Jupyter notebook cells.notebook_path, new_source (required), cell_number, cell_type, edit_mode
patchApply unified diff patches.patch (required), file_path
file_searchFuzzy filename search in workspace.query (required), limit
memory_writeAppend project memory notes.content (required), file
undoRevert the latest ghost snapshot.rollout_path (required)
backlogManage beads backlog issues (ready, show, update, etc.).command (required), command-specific fields
questionAsk the user for mid-turn input and wait for a reply.question (required), options

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"}

Question Tool (Ask-User)

question is a built-in interaction tool for user input during an active turn. Instead of completing immediately, runtime emits a question request event and waits for Op::QuestionReply.

Schema:

  • question: string (required) - prompt text shown to the user
  • options: string[] (optional) - predefined answer choices

Runtime behavior:

  • Core intercepts this tool path in crates/core/src/turn/tool_execution.rs (handle_question_tool).
  • Frontends receive Event::QuestionRequest { request_id, question, options, agent_name }.
  • The tool result becomes the answer text returned by the user.

References:

  • specs/protocol.md (Event::QuestionRequest, Op::QuestionReply)
  • specs/core-runtime.md (NeedQuestion, AwaitingQuestion)

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.