Overview

Agent Swarm is Allternit’s canonical tool registry and the home for agent-facing tool implementations. It defines the JSON Schema contracts, safety metadata, and entrypoints that the runtime uses to discover and execute tools, and it ships reference implementations for browser automation, document generation, and implementation-run landing. The registry lives at tools/agent-swarm/tool_registry.json and is validated by the platform’s law/audit scripts. Each entry declares:
  • A stable tool id and human-readable title.
  • kind (read, write, exec, destructive) for permission policy matching.
  • safety_level (safe, caution, danger, critical) for approval gating.
  • inputs_schema and outputs_schema in JSON Schema.
  • preconditions such as WIH_VALID, TASK_RUNNING, and APPROVAL_TOKEN_VALID.
  • An entrypoint that maps to a source file, kernel tool, or HTTP endpoint.
Tool implementations are plain TypeScript modules that export tool, inputSchema, outputSchema, and an execute function. The runtime loads them into the Native Tool Belt or forwards calls to the appropriate service.

What’s in Agent Swarm

The tools/agent-swarm/ directory contains three reference tool implementations plus the registry: The registry also references tools implemented elsewhere — kernel file-system tools, Canvas connectors, Office local handlers, desktop automation, and the ACI computer tool. At execution time the dispatcher resolves the entrypoint to the right backend.

Registry schema

Each tool in tool_registry.json follows this shape:

Kinds

Safety levels

Preconditions

Agent Browser

The agent-browser.automation tool controls a headless browser through a small CLI wrapper. It is optimized for agent use: it returns accessibility snapshots with deterministic element refs (@e1, @e2) and supports semantic selectors, screenshots, and session persistence.

Setup

Install the agent-browser CLI globally and download Chromium:

Actions

Example: navigate and extract text

Example: fill a form

Selectors

  • Deterministic refs (recommended): @e1, @e2 from a snapshot.
  • Semantic: role=button[name='Submit'], label=Email, text='Sign in', placeholder=Search.
  • CSS: #login, .nav > a:first-child.

Autoland

The autoland tool requests that a completed and validated implementation run be landed into the project root. It acts as the agent-facing proxy for the Rails autoland gate.

Input

Example

In production the platform routes this call to the internal Rails service at POST /api/v1/rails/gate/autoland. The tool itself only exposes the contract; the actual merge happens inside the gated Rails flow.

Document Generator

The document-generator tool is a Zod-typed HTTP bridge to the Document Generator FastAPI service. It generates PPTX photo-card decks, DOCX/PDF study guides, XLSX rubrics, and Canvas modules.

Configuration

Actions

Example: generate a study guide

Example: generate a photo-card deck

Calling tools through the runtime

Tools registered in Agent Swarm are surfaced through the same execution paths as the Native Tool Belt:
  • In-process via the ToolRegistry and NativeToolBelt.
  • Over HTTP via POST /api/v1/tools/execute.
  • Via the MCP server surface at /mcp/server.

REST example

Response:

SDK example

Adding a new tool to the registry

  1. Create a TypeScript module under tools/agent-swarm/<tool-name>/mod.ts.
  2. Export tool, inputSchema, outputSchema, and execute.
  3. Add an entry to tools/agent-swarm/tool_registry.json with the correct kind, safety_level, and preconditions.
  4. Run the registry validation script:
For tools that need organization-wide sharing or sandbox isolation, prefer Server Tools instead.

Error handling

Tool implementations return tool-level failures with success: false and an error string rather than throwing. HTTP callers receive HTTP 200 and inspect success:
Permission policies may also return HTTP 202 with approval_required before the tool runs. See Native Tool Belt for details on approvals and policy rules.