> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opencompany.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Tools

> Tool nodes that give AI Agents capabilities to perform actions

# AI Tools

Tool nodes provide capabilities that AI Agents can invoke during reasoning. Each tool defines a schema that the LLM understands and uses to decide when and how to call the tool.

## How Tools Work

1. **Connect** Tool nodes to the AI Agent's `input-tools` handle (diamond shape)
2. **Agent discovers** connected tools and their schemas
3. **LLM decides** when to call tools based on the user's request
4. **Tool executes** and returns results to the agent
5. **Agent continues** reasoning with the tool's output

```
[Calculator Tool] --+
                    +--(tools handle)--> [AI Agent] --> [Output]
[Web Search Tool] --+
```

## Available Tools

| Tool                        | Description                     | Use Case                             |
| --------------------------- | ------------------------------- | ------------------------------------ |
| Calculator                  | Math operations                 | Calculations, arithmetic             |
| Current Time                | Date/time with timezone         | Scheduling, time-based logic         |
| Timer                       | Set delays and timers           | Rate limiting, scheduled pauses      |
| Task Manager                | Track delegated sub-agent tasks | Check status/results of child agents |
| Write Todos                 | Structured task-list planning   | Multi-step task organization         |
| Agent Builder               | Grow the canvas at runtime      | Add tools/skills/teammates mid-run   |
| DuckDuckGo Search           | Free web search (no API key)    | Current information, research        |
| Brave / Serper / Perplexity | API-key web search              | Higher-quality search, AI answers    |
| Android Toolkit             | Android device control          | Device automation                    |
| Agent Delegation            | Delegate to a child agent       | Complex sub-tasks                    |

<Info>
  Many nodes are **dual-purpose** - they work as standalone workflow nodes AND as AI Agent tools. Search nodes (Brave, Serper, Perplexity), the code executors (Python, Monty, JavaScript, TypeScript), WhatsApp, Telegram, Google Workspace, email, and browser nodes all fill the same tool schema when connected to an agent's `input-tools` handle. See [Documents](/nodes/documents), [WhatsApp](/nodes/whatsapp), and [AI Agents](/nodes/ai-agent) for those.
</Info>

***

## Calculator Tool

Performs mathematical operations including basic arithmetic and advanced functions.

### Operations

| Operation | Description    | Example      |
| --------- | -------------- | ------------ |
| add       | Addition       | 5 + 3 = 8    |
| subtract  | Subtraction    | 10 - 4 = 6   |
| multiply  | Multiplication | 6 \* 7 = 42  |
| divide    | Division       | 20 / 4 = 5   |
| power     | Exponentiation | 2^8 = 256    |
| sqrt      | Square root    | sqrt(16) = 4 |
| mod       | Modulo         | 17 % 5 = 2   |
| abs       | Absolute value | abs(-5) = 5  |

### Parameters

<ParamField path="toolName" type="string" default="calculator">
  Tool identifier shown to the LLM
</ParamField>

<ParamField path="toolDescription" type="string">
  Description of the tool's capabilities for the LLM
</ParamField>

### Schema (LLM View)

```json theme={null}
{
  "operation": "add | subtract | multiply | divide | power | sqrt | mod | abs",
  "a": "number (first operand)",
  "b": "number (second operand, optional for sqrt/abs)"
}
```

### Example Interaction

```
User: "What's 15% of 230?"
Agent: [Calls calculator with multiply(230, 0.15)]
       "15% of 230 is 34.5"
```

***

## Current Time Tool

Gets the current date and time with timezone support.

### Parameters

<ParamField path="toolName" type="string" default="currentTime">
  Tool identifier shown to the LLM
</ParamField>

<ParamField path="toolDescription" type="string">
  Description of the tool's capabilities
</ParamField>

<ParamField path="defaultTimezone" type="string" default="UTC">
  Default timezone (e.g., "America/New\_York", "Europe/London", "Asia/Tokyo")
</ParamField>

### Schema (LLM View)

```json theme={null}
{
  "timezone": "string (optional, defaults to UTC)"
}
```

### Output

```json theme={null}
{
  "iso": "2026-01-30T14:30:00-05:00",
  "timezone": "America/New_York",
  "unix": 1769801400
}
```

### Example Interaction

```
User: "What time is it in Tokyo?"
Agent: [Calls get_current_time with timezone="Asia/Tokyo"]
       "It's currently 4:30 AM on Friday in Tokyo."
```

***

## Timer Tool

The Timer node is a **dual-purpose node** that works both as a workflow delay node and as an AI Agent tool. When connected to an agent's `input-tools` handle, the agent can set timers and delays programmatically.

### Parameters

<ParamField path="toolName" type="string" default="timer">
  Tool identifier shown to the LLM
</ParamField>

<ParamField path="delay" type="number" required>
  Delay duration
</ParamField>

<ParamField path="unit" type="select" default="seconds">
  Time unit: seconds, minutes, hours
</ParamField>

### Schema (LLM View)

```json theme={null}
{
  "delay": "number (duration to wait)",
  "unit": "seconds | minutes | hours"
}
```

### Output

```json theme={null}
{
  "delayed": true,
  "duration_ms": 5000,
  "completed_at": "2025-01-30T10:30:05Z"
}
```

### Example Interaction

```
User: "Wait 5 seconds before checking the battery again"
Agent: [Calls timer with delay=5, unit="seconds"]
       [Calls battery status after timer completes]
       "After waiting 5 seconds, the battery is now at 73%."
```

<Info>
  The Timer node appears in both the **Schedulers** section (as a workflow node) and the **Tools** section (as an AI Agent tool). See [Schedulers & Triggers](/nodes/schedulers) for workflow usage.
</Info>

***

## Task Manager Tool

Tracks tasks delegated to child sub-agents. When a parent agent delegates work to a connected agent (fire-and-forget), it uses this tool to check on progress and results.

### Schema (LLM View)

```json theme={null}
{
  "action": "create | list | complete | delete | update",
  "task_id": "string (optional)",
  "title": "string (optional)",
  "description": "string (optional)",
  "status": "string (optional)"
}
```

### Example Interaction

```
User: "Did the coding agent finish that JSON parser?"
Agent: [Calls task_manager with action="list"]
       "The coding agent completed the task - here's the function it wrote..."
```

***

## Write Todos Tool

Structured task-list planning for complex multi-step operations. The agent maintains a checklist of pending / in-progress / completed items, updating it as it works. This helps the agent stay organized and lets you watch progress in real time.

### Schema (LLM View)

```json theme={null}
{
  "todos": [
    { "content": "string (task description)", "status": "pending | in_progress | completed" }
  ]
}
```

### Editable Current Todos Panel

When you select a Write Todos node, its parameter panel shows the LIVE todo list (shared by all Write Todos nodes in the same workflow). You can add, remove, edit text, or click an item to cycle its status - and the agent sees your edits on its next turn.

### Example Interaction

```
User: "Build a login form with validation and tests"
Agent: [Calls write_todos to plan: 1) create form, 2) add validation, 3) write tests]
       [Marks each item in_progress then completed as it works]
```

<Tip>
  The agent only reaches for this tool on genuinely multi-step work (3+ steps). Trivial requests are handled directly without a todo list.
</Tip>

***

## Agent Builder Tool

Lets an agent grow its own toolset at runtime by mutating the canvas. The LLM sees a single `agentBuilder` tool with an `operation` selector.

| Operation       | What it does                                                              |
| --------------- | ------------------------------------------------------------------------- |
| inspect\_canvas | Read-only snapshot of nodes, edges, and what's wired to the calling agent |
| add\_tool       | Spawn a tool node and wire it into the caller's tools handle              |
| add\_skill      | Toggle a skill on the caller's Master Skill (creating one if needed)      |
| add\_subagent   | Spawn a delegate agent and wire it to a team-lead's teammates handle      |

<Info>
  Tools added mid-run become callable on the agent's **next** turn, not the current one - the agent loop binds tools at the start of each turn. Each operation's summary ends with "Available on your next turn" so the agent knows to wait.
</Info>

***

## Web Search Tools

MachinaOs ships one free web-search tool plus three dual-purpose search nodes that also work as standalone workflow nodes.

### DuckDuckGo Search

Free web search - no API key required. Exposed to the agent as the `web_search` tool.

<ParamField path="query" type="string" required>
  The search query
</ParamField>

<ParamField path="max_results" type="number">
  Maximum number of results to return
</ParamField>

```json theme={null}
{
  "results": [
    { "title": "Result Title", "url": "https://example.com/page", "snippet": "Brief description..." }
  ]
}
```

### Brave / Serper / Perplexity (dual-purpose, API key required)

These are dual-purpose nodes - they run as normal workflow search nodes AND as AI Agent tools when connected to the tools handle.

| Node              | Tool                | Backend               | Notes                                                       |
| ----------------- | ------------------- | --------------------- | ----------------------------------------------------------- |
| Brave Search      | `brave_search`      | Brave Search API      | Web results with titles, snippets, URLs                     |
| Serper Search     | `serper_search`     | Google via Serper API | Web / news / images / places search types + knowledge graph |
| Perplexity Search | `perplexity_search` | Perplexity Sonar AI   | AI-generated answer with inline citations and source URLs   |

### Provider Comparison

| Feature        | DuckDuckGo | Brave / Serper / Perplexity |
| -------------- | ---------- | --------------------------- |
| Cost           | Free       | Paid (API key)              |
| Setup          | None       | API key in Credentials      |
| Result Quality | Good       | Excellent                   |

### Example Interaction

```
User: "What are the latest developments in quantum computing?"
Agent: [Calls web_search with query="quantum computing news 2026"]
       "Here are the latest developments in quantum computing:
        1. IBM announced a new 1000-qubit processor...
        2. Google achieved quantum error correction milestone..."
```

***

## Android Toolkit

Gateway tool that aggregates Android service nodes for device control.

### Architecture

The Android Toolkit follows the **Sub-Node** pattern from n8n and **Toolkit** pattern from LangChain:

```
[Battery Monitor] --+
[WiFi Automation] --+--(main input)--> [Android Toolkit] --(tools handle)--> [AI Agent]
[Location] --------+
```

Connected Android service nodes define what the toolkit can do. The LLM sees a single `android_device` tool with capabilities based on connected services.

### Parameters

<ParamField path="toolName" type="string" default="android_device">
  Tool identifier shown to the LLM
</ParamField>

<ParamField path="toolDescription" type="string">
  Description of the toolkit's capabilities
</ParamField>

### Schema (Dynamic)

The schema is built dynamically based on connected Android service nodes:

```json theme={null}
{
  "service_id": "battery | wifi_automation | location | ...",
  "action": "status | enable | disable | get | set | ...",
  "parameters": {
    // Action-specific parameters
  }
}
```

### Connecting Services

1. Add Android service nodes (Battery Monitor, WiFi Automation, etc.)
2. Connect them to the Android Toolkit's main input
3. Connect the Toolkit to the AI Agent's tools handle

Only connected services are available to the agent.

### Tool Schema Editor

The Android Toolkit includes a schema editor for customizing how the LLM sees each service:

1. Select the Android Toolkit node
2. Open the Tool Schema Editor
3. Select a connected service
4. Customize the description, fields, and types
5. Save changes

### Example Interaction

```
User: "Check the battery level and turn on WiFi if it's above 50%"
Agent: [Calls android_device with service_id="battery", action="status"]
       Battery is at 72%
       [Calls android_device with service_id="wifi_automation", action="enable"]
       "Battery is at 72%, which is above 50%. I've enabled WiFi."
```

### Available Services

When corresponding Android service nodes are connected:

| Service                | Actions                         | Description                           |
| ---------------------- | ------------------------------- | ------------------------------------- |
| battery                | status                          | Battery level, charging state, health |
| wifi\_automation       | status, enable, disable, scan   | WiFi control                          |
| bluetooth\_automation  | status, enable, disable, paired | Bluetooth control                     |
| location               | get                             | GPS coordinates                       |
| app\_launcher          | launch                          | Launch apps by package name           |
| app\_list              | list                            | Installed applications                |
| audio\_automation      | get, set, mute, unmute          | Volume control                        |
| camera\_control        | info, capture                   | Camera operations                     |
| motion\_detection      | get                             | Accelerometer/gyroscope data          |
| environmental\_sensors | get                             | Temperature, humidity, light          |

***

## Tool Execution Flow

When the AI Agent calls a tool:

1. **Status broadcast** - `executing_tool` status sent to frontend
2. **Tool node highlighted** - Shows cyan border and pulse animation
3. **Handler executed** - Backend runs the tool's handler function
4. **Result returned** - Output sent back to the agent
5. **Agent continues** - Incorporates result into response

### Tool Output in Variables

Tool outputs are available as template variables:

```
{{calculatorTool.result}}
{{duckduckgoSearch.results}}
{{androidTool.output}}
```

***

## Agent Delegation Tool

AI Agents and specialized agents can be connected as tools to parent agents, enabling hierarchical task delegation. MachinaOs ships 16 specialized agents (Android, Coding, Web, Task, Social, Travel, Tool, Productivity, Payments, Consumer, Autonomous, Orchestrator, AI Employee) plus the RLM, Claude Code, and Codex agents.

### How It Works

1. Connect any agent to a parent agent's `input-tools` handle
2. Parent calls `delegate_to_<agent_type>(task, context)`
3. The child agent runs with its own connected tools, skills, and memory
4. Team-lead agents (Orchestrator, AI Employee) delegate through a dedicated `input-teammates` handle

### Schema

```json theme={null}
{
  "task": "string (required) - The task to delegate",
  "context": "string (optional) - Additional context"
}
```

### Example

```
[AI Agent] <--tools-- [Coding Agent] <--tools-- [Python Executor]
```

Parent delegates: `delegate_to_coding_agent(task="Write a function to parse JSON")`

Child agent executes independently with its own connected tools.

<Tip>
  Use agent delegation for complex sub-tasks that don't need immediate results.
</Tip>

***

## Creating Custom Tools

Custom tools are backend plugins. Each tool is a single self-contained folder under `server/nodes/tool/<name>/` rooted at `__init__.py` - a `ToolNode` subclass whose Pydantic `Params` model drives the LLM-visible schema. The plugin auto-registers on import; no frontend edits are needed.

Key steps:

1. Create `server/nodes/tool/<name>/__init__.py` with a `ToolNode` subclass
2. Define a Pydantic `Params` model (its fields become the tool's LLM schema)
3. Implement the operation with an `@Operation` method
4. Set `component_kind = "tool"` and add `group = ("tool", "ai")`

See the Nodes Cookbook (`server/nodes/README.md`) and the Node Creation Guide in the repository for the full recipe.

***

## Tips

<Tip>
  Connect only the tools the agent needs. Too many tools can confuse the LLM.
</Tip>

<Tip>
  Provide clear **toolDescription** to help the LLM understand when to use each tool.
</Tip>

<Tip>
  Use **Web Search** for current information not in the model's training data.
</Tip>

<Tip>
  The **Android Toolkit** only shows services you connect - add only what you need.
</Tip>

<Warning>
  Tool nodes execute when the AI Agent calls them, not when the workflow runs. They're passive until invoked.
</Warning>

***

## Related

<CardGroup cols={2}>
  <Card title="AI Agents" icon="robot" href="/nodes/ai-agent">
    Connect tools to AI Agent
  </Card>

  <Card title="AI Skills" icon="wand-magic-sparkles" href="/nodes/skills">
    Skills that use tools
  </Card>

  <Card title="Android Nodes" icon="mobile" href="/nodes/android">
    16 Android service nodes
  </Card>

  <Card title="Webhooks" icon="webhook" href="/nodes/webhooks">
    HTTP Request node
  </Card>
</CardGroup>
