Skip to main content

Tools Reference

MicroClaw exposes 27 built-in tools to LLM through JSON Schema definitions (plus optional MCP-federated tools). LLM selects and calls tools automatically based on your request.

For anti-drift, this page is complemented by the generated source-of-truth at Generated Tools, produced from code by scripts/generate_docs_artifacts.mjs.

Skill workflows are provided by local SKILL.md files (for example apple-notes, apple-reminders, apple-calendar, weather) and loaded through activate_skill.

Tool List

#ToolCategoryDescription
1bashShellExecute shell commands with configurable timeout
2browserWebHeadless browser automation via agent-browser CLI
3read_fileFile I/ORead files with line numbers, optional offset/limit
4write_fileFile I/OCreate or overwrite files (auto-creates directories)
5edit_fileFile I/OFind-and-replace with uniqueness validation
6globSearchFind files by glob pattern (**/*.rs)
7grepSearchRegex search across file contents
8read_memoryMemoryRead persistent AGENTS.md memory
9write_memoryMemoryWrite persistent AGENTS.md memory
10web_searchWebSearch via DuckDuckGo (top 8 results)
11web_fetchWebFetch a URL and return plain text (max 20KB)
12send_messagechatSend text mid-conversation; supports file attachments for Telegram/Discord
13schedule_taskSchedulerCreate a recurring or one-time task
14list_scheduled_tasksSchedulerList active/paused tasks for a chat
15pause_scheduled_taskSchedulerPause a scheduled task
16resume_scheduled_taskSchedulerResume a paused task
17cancel_scheduled_taskSchedulerCancel a scheduled task
18get_task_historySchedulerView execution history for a task
19export_chatchatExport chat history to markdown
20sub_agentAgentDelegate a bounded sub-task to a restricted sub-agent
21activate_skillSkillsLoad specialized local skill instructions
22sync_skillsSkillsSync external skills into local ~/.microclaw/skills with normalized metadata
23todo_readPlanningRead persistent todo list for a chat
24todo_writePlanningWrite/replace persistent todo list for a chat
25structured_memory_searchMemorySearch structured memories (keyword, optional archived include)
26structured_memory_deleteMemoryArchive a structured memory by ID (soft delete)
27structured_memory_updateMemoryUpdate structured memory content/category by ID

Detailed Parameters

Permission model

Tool calls are authorized by caller chat:

  • Non-control chats can only operate on their own chat_id
  • Control chats (control_chat_ids) can operate across chats
  • Global memory writes (write_memory with scope = "global") require control-chat privileges

This applies to send_message, scheduler tools, export_chat, todo_*, and chat-scoped memory access.

bash

Execute a shell command.

ParameterTypeRequiredDescription
commandstringYesThe bash command to execute
timeout_secsintegerNoTimeout in seconds (default: 120)

Behavior: Returns stdout + stderr. Output truncated at 30,000 characters. Non-zero exit codes are reported as errors.


browser

Headless browser automation via agent-browser CLI. Requires agent-browser to be installed (see Installation).

ParameterTypeRequiredDescription
commandstringYesThe agent-browser command to run
timeout_secsintegerNoTimeout in seconds (default: 30)

Commands by category:

CategoryCommands
Navigationopen <url>, back, forward, reload, close
Snapshotsnapshot (-i interactive only, -c compact)
Interactionclick, dblclick, fill, type, press, hover, select, check, uncheck, upload, drag
Data extractionget text/html/value/attr/title/url/count/box <sel>
State checksis visible/enabled/checked <sel>
Screenshot/PDFscreenshot [path] (--full for full page), pdf <path>
JavaScripteval <js>
Cookiescookies, cookies set <name> <val>, cookies clear
Storagestorage local [key], storage local set <k> <v>, storage local clear (same for session)
Tabstab, tab new [url], tab <n>, tab close [n]
Framesframe <sel>, frame main
Dialogsdialog accept [text], dialog dismiss
Viewportset viewport <w> <h>, set device <name>, set media dark/light
Networknetwork route <url> (--abort, --body <json>), network requests
Waitwait <sel|ms|--text|--url|--load|--fn>
Auth statestate save <path>, state load <path>
Semantic findfind role/text/label/placeholder <value> <action> [input]
Scrollingscroll <dir> [px], scrollintoview <sel>

State persistence: Browser state persists at two levels:

  • Within a conversation (--session): cookies, page state, and tabs stay alive across tool calls
  • Across conversations (--profile): cookies, localStorage, IndexedDB, and login sessions are saved to disk per chat at <data_dir>/groups/<chat_id>/browser-profile/

Output truncated at 30,000 characters. Always run snapshot -i after navigation or interaction to see the updated page state.


read_file

Read file content with line numbers.

ParameterTypeRequiredDescription
pathstringYesFile path to read
offsetintegerNoLine number to start from (1-based)
limitintegerNoMaximum lines to read (default: 2000)

Output format: {line_number}\t{content} per line.


write_file

Create or overwrite a file.

ParameterTypeRequiredDescription
pathstringYesFile path to write
contentstringYesContent to write

Behavior: Creates parent directories automatically if they don't exist.


edit_file

Replace an exact string in a file.

ParameterTypeRequiredDescription
pathstringYesFile path to edit
old_stringstringYesExact string to find (must be unique)
new_stringstringYesReplacement string

Validation: Fails if old_string is not found or appears more than once.


glob

Find files matching a glob pattern.

ParameterTypeRequiredDescription
patternstringYesGlob pattern (e.g., **/*.rs, src/*.ts)
pathstringNoBase directory (default: current directory)

Behavior: Results sorted alphabetically. Truncated at 500 matches.


grep

Search file contents with regex.

ParameterTypeRequiredDescription
patternstringYesRegex pattern to search for
pathstringNoFile or directory (default: current directory)
globstringNoGlob filter for filenames (e.g., *.rs)

Behavior: Recursively searches directories. Skips hidden directories (.git, .hidden), node_modules, and target. Results truncated at 500 matches. Max 10,000 files scanned.


read_memory

Read persistent AGENTS.md memory file.

ParameterTypeRequiredDescription
scopestringYes"global", "bot", or "chat"
chat_idintegerFor chat scopeChat ID for chat-scoped memory

write_memory

Write to AGENTS.md memory file.

ParameterTypeRequiredDescription
scopestringYes"global", "bot", or "chat"
chat_idintegerFor chat scopeChat ID for chat-scoped memory
contentstringYesContent to write (global/bot replace full file; chat updates latest sender section when available)

Search structured memories persisted in SQLite.

ParameterTypeRequiredDescription
querystringYesKeyword query
limitintegerNoMax results (default 10, max 50)
include_archivedbooleanNoInclude archived memories (default false)

structured_memory_delete

Archive a structured memory by ID (soft delete).

ParameterTypeRequiredDescription
idintegerYesMemory row ID

structured_memory_update

Update structured memory content/category in place.

ParameterTypeRequiredDescription
idintegerYesMemory row ID
contentstringYesNew content
categorystringNoPROFILE / KNOWLEDGE / EVENT

Search the web via DuckDuckGo.

ParameterTypeRequiredDescription
querystringYesSearch query

Returns: Top 8 results with title, URL, and snippet.


web_fetch

Fetch a URL and return plain text.

ParameterTypeRequiredDescription
urlstringYesURL to fetch

Behavior: Strips HTML tags, collapses whitespace, truncates at 20KB. Follows up to 5 redirects. 15-second timeout.


send_message

Send a chat message mid-conversation.

ParameterTypeRequiredDescription
chat_idintegerYesChat ID to send to
textstringNoMessage text
attachment_pathstringNoLocal file path (channel attachment upload)
captionstringNoOptional caption for attachment

Validation: You must provide text and/or attachment_path.

Notes:

  • attachment_path supports Telegram / Discord targets
  • Telegram sends as document attachment
  • Discord sends as file attachment in channel message
  • Web chat targets still append text to local Web conversation

schedule_task

Create a scheduled task.

ParameterTypeRequiredDescription
chat_idintegerYesChat ID for results
promptstringYesPrompt to execute at scheduled time
schedule_typestringYes"cron" or "once"
schedule_valuestringYes6-field cron expression or ISO 8601 timestamp

list_scheduled_tasks

List tasks for a chat.

ParameterTypeRequiredDescription
chat_idintegerYesChat ID to list tasks for

Returns: Active and paused tasks with ID, status, prompt, schedule, and next run time.


pause_scheduled_task / resume_scheduled_task / cancel_scheduled_task

Manage a scheduled task by ID.

ParameterTypeRequiredDescription
task_idintegerYesTask ID to pause/resume/cancel

Adding a New Tool

  1. Create src/tools/my_tool.rs implementing the Tool trait:
    • name() — tool name string
    • definition()ToolDefinition with JSON Schema
    • execute(input) — async execution returning ToolResult
  2. Add pub mod my_tool; to src/tools/mod.rs
  3. Register in ToolRegistry::new() with Box::new(my_tool::MyTool::new(...))

Trait/runtime note: Tool and ToolResult live in microclaw_tools::runtime; src/tools/mod.rs reuses those shared primitives.

If your tool needs shared state (Bot, Database), add a constructor that accepts the dependency.