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 attools/agent-swarm/tool_registry.json and is validated by the platform’s law/audit scripts. Each entry declares:
- A stable tool
idand human-readable title. kind(read,write,exec,destructive) for permission policy matching.safety_level(safe,caution,danger,critical) for approval gating.inputs_schemaandoutputs_schemain JSON Schema.preconditionssuch asWIH_VALID,TASK_RUNNING, andAPPROVAL_TOKEN_VALID.- An
entrypointthat maps to a source file, kernel tool, or HTTP endpoint.
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
Thetools/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 intool_registry.json follows this shape:
Kinds
Safety levels
Preconditions
Agent Browser
Theagent-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 theagent-browser CLI globally and download Chromium:
Actions
Example: navigate and extract text
Example: fill a form
Selectors
- Deterministic refs (recommended):
@e1,@e2from a snapshot. - Semantic:
role=button[name='Submit'],label=Email,text='Sign in',placeholder=Search. - CSS:
#login,.nav > a:first-child.
Autoland
Theautoland 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
POST /api/v1/rails/gate/autoland. The tool itself only exposes the contract; the actual merge happens inside the gated Rails flow.
Document Generator
Thedocument-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
ToolRegistryandNativeToolBelt. - Over HTTP via
POST /api/v1/tools/execute. - Via the MCP server surface at
/mcp/server.
REST example
SDK example
Adding a new tool to the registry
- Create a TypeScript module under
tools/agent-swarm/<tool-name>/mod.ts. - Export
tool,inputSchema,outputSchema, andexecute. - Add an entry to
tools/agent-swarm/tool_registry.jsonwith the correctkind,safety_level, andpreconditions. - Run the registry validation script:
Error handling
Tool implementations return tool-level failures withsuccess: false and an error string rather than throwing. HTTP callers receive HTTP 200 and inspect success:
approval_required before the tool runs. See Native Tool Belt for details on approvals and policy rules.