---
name: elsai-agents-tools
description: Complete guide for using elsai-agents-tools prebuilt tools with the Elsai Agent SDK — covers installation, registration, class-based providers, optional extras, and multi-agent tools
allowed-tools: Read Write Edit Bash
metadata:
  version: "0.1.0"
  install: "pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents-tools==0.1.0"
---

# Elsai Prebuilt Tools — Developer Skill

Use this skill whenever the developer asks about ready-made agent tools from **`elsai-agents-tools`** — file I/O, shell, web search, RAG, memory, browser automation, or multi-agent orchestration tools.

Requires **`elsai-agents>=0.2.0`** installed separately. Python import namespace: **`elsai_tools`**.

---

## 1. Installation

```bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents-tools==0.1.0

# With optional extras
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[mem0-memory]==0.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[local-chromium-browser]==0.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[agent-core-code-interpreter]==0.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[diagram]==0.1.0"
```

---

## 2. Registering Tools

Rules:
- Import from `elsai_tools.<module>` — one function per module
- Pass tool functions to `Agent(tools=[...])`
- Do **not** redefine tools with `@tool` when prebuilt equivalents exist

```python
from elsai import Agent
from elsai_tools.shell import shell
from elsai_tools.file_read import file_read
from elsai_tools.file_write import file_write
from elsai_tools.http_request import http_request
from elsai_tools.tavily import tavily_search

agent = Agent(
    model="us.amazon.nova-pro-v1:0",
    system_prompt="You are a helpful assistant with file, shell, and web access.",
    tools=[shell, file_read, file_write, http_request, tavily_search],
)

result = agent("Search for Elsai Agents and summarise the top result")
```

### Direct tool invocation
```python
agent.tool.shell(command="ls -la", work_dir="/app")
agent.tool.file_read(path="./data/config.json")
agent.tool.http_request(method="GET", url="https://api.example.com/status")
```

---

## 3. Class-Based Tool Providers

Some tools are classes — instantiate the provider, then register a method or `.tools` list.

```python
from elsai import Agent
from elsai_tools.code_interpreter import AgentCoreCodeInterpreter
from elsai_tools.browser import LocalChromiumBrowser
from elsai_tools.agent_core_memory import AgentCoreMemoryToolProvider
from elsai_tools.a2a_client import A2AClientToolProvider

interpreter = AgentCoreCodeInterpreter(region="us-west-2")
browser = LocalChromiumBrowser()
memory = AgentCoreMemoryToolProvider(
    memory_id="memory-123",
    actor_id="user-456",
    session_id="session-789",
    namespace="default",
)
a2a = A2AClientToolProvider(known_agent_urls=["http://agent.example.com"])

agent = Agent(tools=[
    interpreter.code_interpreter,
    browser.browser,
    *memory.tools,
    *a2a.tools,
])
```

| Provider | Register as |
|---|---|
| `AgentCoreCodeInterpreter` | `interpreter.code_interpreter` |
| `LocalChromiumBrowser` | `browser.browser` |
| `AgentCoreMemoryToolProvider` | `*provider.tools` |
| `A2AClientToolProvider` | `*provider.tools` |

---

## 4. Tool Categories

| Category | Example import |
|---|---|
| File I/O | `from elsai_tools.file_read import file_read` |
| Shell | `from elsai_tools.shell import shell` |
| Web / HTTP | `from elsai_tools.http_request import http_request` |
| Search | `from elsai_tools.tavily import tavily_search` |
| RAG | `from elsai_tools.retrieve import retrieve` |
| Memory | `from elsai_tools.memory import memory` |
| Multi-agent | `from elsai_tools.swarm import swarm` |
| AWS | `from elsai_tools.use_aws import use_aws` |

---

## 5. Optional Extras

| Extra | Enables |
|---|---|
| `mem0-memory` | `mem0_memory` |
| `elasticsearch-memory` | `elasticsearch_memory` |
| `mongodb-memory` | `mongodb_memory` |
| `local-chromium-browser` | `LocalChromiumBrowser` |
| `agent-core-code-interpreter` | `AgentCoreCodeInterpreter` |
| `diagram` | `diagram` |
| `rss` | `rss` |
| `a2a-client` | A2A client tools |

Install an extra:

```bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[EXTRA]==0.1.0"
```

---

## 6. Plugins + Prebuilt Tools

Plugins do not ship execution tools — register prebuilt tools alongside plugins:

```python
from elsai import Agent
from elsai.agent import AgentConfig
from elsai.plugins.skills import AgentSkills
from elsai_tools.file_read import file_read
from elsai_tools.shell import shell

plugin = AgentSkills(skills="./skills/")
agent = Agent(tools=[file_read, shell], config=AgentConfig(plugins=[plugin]))
```

---

## 7. Multi-Agent Prebuilt Tools

```python
from elsai import Agent
from elsai_tools.swarm import swarm
from elsai_tools.graph import graph

# Swarm tool — agents defined in state or prompts
agent = Agent(tools=[swarm])

# Graph tool — pipeline defined in state
agent = Agent(tools=[graph])
```

---

## Common Mistakes to Avoid

1. **Mocking `file_read` / `shell` with `@tool`** — import from `elsai_tools` instead.
2. **Assuming tools ship with `elsai-agents`** — `elsai-agents-tools` is a separate pip package.
3. **Forgetting plugins need tools** — `AgentSkills` does not include file or shell tools.
4. **Missing pip extra** — browser, Mem0, diagram, and AgentCore tools require their extra installed.
5. **Wrong import path** — use `from elsai_tools.shell import shell`, not `from elsai_tools import shell`.
6. **Class-based registration errors** — pass `interpreter.code_interpreter`, not the class itself.
7. **Spreading `.tools` incorrectly** — use `*provider.tools` for memory and A2A providers.
