Tools Documentation

Tools Documentation

Overview

Agent capability tools come from MCP servers (mcp.json). Core keeps a small set of
native tools for run control and memory/archive recovery. The ToolExecutor validates,
times out, and safely wraps all tool results.

Native tools

Tool When
report_inability Always
load_message app.message_archive_enabled
load_tool_result [memory] + memory.enabled
search_tool_results memory + memory.tool_result_search_enabled

MCP tools

Loaded from mcp.json only. Names: mcp_{server}_{tool}. Lazy connect (stdio or HTTP).
See mcp.md and host_integrations.md.

Constraints

  1. JSON Schema validation — arguments must match schema
  2. Timeoutapp.default_tool_timeout per tool (default 30s); MCP may override
  3. Structured parsing — tool calls via agents/tool_parser.py (no regex extraction)
  4. Async execution — tools are async and return strings
  5. Safe errors — no stack traces to the LLM

Extension

Prefer adding capabilities as MCP servers in the host's mcp.json rather than
shipping new built-in tools in Core.

For a new native recovery/meta tool:

  1. Define a Tool in tools/
  2. Register in agents/registry.py (or via memory/session stack)
  3. Auto-grant in AgentLoop._resolve_allowed_tools if always available
  4. Document in your host prompt_files (or bundled templates if maintaining Core defaults)
  5. Add tests

Tool call format

{"tool": "mcp_filesystem_read_file", "args": {"path": "test.txt"}}

Or plain text for the final answer (no JSON).