AAnvio
Tools & MCP

Built-in Tools

The Anvio tool gateway — 73 built-in tools with a permissions matrix, prefixed anvio_tools__*, configured per workspace.

5 min read

Anvio ships a built-in tool gateway (@anvio/tools) so agents get useful tools without any external MCP setup. Every built-in tool is namespaced anvio_tools__<name> and gated by workspace/tools/gateway.yaml.

ToolGateway

ToolGateway (packages/tools/src/gateway.ts) loads workspace/tools/gateway.yaml, falling back to DEFAULT_TOOL_GATEWAY_YAML if the file doesn't exist yet:

export class ToolGateway {
  static async load(workspaceRoot: string, ctx?: BuiltinToolContext): Promise<ToolGateway> { /* ... */ }

  listTools(): string[] {
    if (!this.spec.enabled) return [];
    return Object.entries(this.spec.tools)
      .filter(([, cfg]) => cfg.enabled)
      .map((name) => `anvio_tools__${name}`);
  }

  getModelToolDefinitions(): ModelToolDefinition[] {
    return buildModelToolDefinitions(this.listTools());
  }

  async call(call: BuiltinToolCall, ctx?: ToolGatewayCallContext): Promise<BuiltinToolResult> { /* ... */ }
}

getModelToolDefinitions() turns the enabled tool list into native tool_use definitions for the model provider — this is how a model actually sees which tools it can call.

Catalog (73 tools)

Grouped by the same categories the gateway config uses. Enabled-by-default status reflects DEFAULT_TOOL_GATEWAY_YAML.

Web & file (15)

ToolDefaultNotes
web_fetchonFetch a URL
web_searchoffRequires WEB_SEARCH_API_KEY (Brave by default)
web_extractonExtract URL → markdown
http_requestonGeneric HTTP request
file_readonRead with line numbers
file_writeoffOverwrite a file
edit_fileoffFind/replace edit
patch_fileoffFuzzy find/replace + diff
append_fileoffAppend to a file
file_deleteoffDelete a file
glob_filesonGlob pattern search
grep_searchonRipgrep-style content search
search_filesonSearch by name or content
list_dironList a directory
path_existsonCheck path existence

Terminal & code (5)

ToolDefaultNotes
run_shelloffRequires a CodeExecutor
terminaloffShell execution, optional background
processoffPoll/kill/log a background process
execute_codeoffJS by default; delegates to CodeExecutor if provided
execute_code_pipeline—Multi-step code execution pipeline

Browser — Playwright session (12)

browser (legacy single-action tool) plus a full session-based set: browser_navigate, browser_snapshot, browser_click, browser_type, browser_scroll, browser_back, browser_press, browser_console, browser_get_images, browser_vision, browser_dialog, browser_cdp. All off by default. browser_cdp additionally requires ANVIO_BROWSER_CDP_GRANT=1 for its extended raw CDP methods.

Media & vision (5)

ToolDefaultNotes
image_generateoff
text_to_speechoff
vision_analyzeoffMultimodal image analysis
video_analyzeoffExtracts a frame via ffmpeg (FFMPEG_BINARY to override), then runs vision analysis
video_generateoffDelegates to an MCP video-gen preset; ANVIO_VIDEO_MOCK=1 for dev/test

Agent orchestration (9)

todo (on), clarify (on), session_search (on), memory_recall (on), delegate_task (off — subagent delegation), cronjob (off), skills_list (on), skill_view (on), skill_manage (off), send_message (off), mixture_of_agents (off).

Kanban (9)

kanban_list, kanban_show, kanban_create, kanban_move, kanban_complete, kanban_block, kanban_unblock, kanban_heartbeat, kanban_comment, kanban_link — all off by default, backed by @anvio/kanban.

Home Assistant (4)

ha_list_entities, ha_get_state, ha_list_services, ha_call_service — REST-backed, off by default.

Niche / platform integrations (8)

x_search, computer_use, discord_admin, spotify_search, feishu_doc_read, rl_tool (Tinker-Atropos RL), yb_tool (Yuanbao action bundle), honcho_tool (Honcho memory context/profile/search/conclude) — off by default, most delegate to an MCP preset via ctx.callMcpTool.

Utility (2)

json_parse, datetime_now — on by default, no external dependency.

computer_use is a permanent stub on this platform — it requires the macOS Accessibility API and cannot run in a headless Linux environment. See docs/69-post-v1.17-gap-register.md, item T1e.

Configuration (workspace/tools/gateway.yaml)

apiVersion: anvio.io/v1
kind: ToolGateway
metadata:
  name: default
spec:
  enabled: true
  tools:
    web_fetch:
      enabled: true
    execute_code:
      enabled: false
    run_shell:
      enabled: false
    # ... one entry per tool, see DEFAULT_TOOL_GATEWAY_YAML in @anvio/tools
  webSearch:
    provider: brave
    apiKeyEnv: WEB_SEARCH_API_KEY

Enable write/exec/browser/kanban tools explicitly — they default to enabled: false because they can modify the filesystem, run arbitrary shell commands, or drive a browser session.

CLI

anvio tools list
anvio tools test anvio_tools__web_extract https://example.com
anvio tools test anvio_tools__search_files '{"pattern":"tool","target":"content"}'

Dispatch and error shape

Every tool call runs through a single switch in runBuiltinTool() (packages/tools/src/builtins/index.ts) and returns a BuiltinToolResult:

interface BuiltinToolResult {
  name: string;
  output: unknown;
  status: 'completed' | 'failed' | 'skipped';
  error?: string;
}

status: 'skipped' means the tool (or the whole gateway) is disabled in config, or a required dependency like workspaceRoot or codeExecutor wasn't supplied to the context — distinct from 'failed', which means the tool ran and threw. See Error Handling for the full convention.

Permissions, approval, and audit

Per docs/08-tools.md, the tool runtime layer adds a permissions matrix, an approval workflow (tools that need human sign-off pause the agent at awaiting_approval), and audit logging.

Not yet shipped

Rate limiting and full sandboxing for built-in tool execution are listed in docs/08-tools.md as a later phase and are not fully implemented for every tool category — code execution has real timeout/memory limits via CodeExecutor (see Docker Runtime), but there is no general per-tool rate limiter yet.

Edit on GitHub

Last updated on

On this page