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

# Tools

> Available tools and capabilities for Agentbase agents

> Agents automatically select and use tools based on your task. No configuration required.

## How Tools Work

Agents automatically choose tools when needed:

```javascript theme={null}
// Agent will automatically use web browsing tools
const research = await agentbase.runAgent({
  message: "Find the latest pricing for our competitors",
});

// Agent will automatically create computer environment and use bash/file tools
const development = await agentbase.runAgent({
  message: "Create a Python script that processes CSV data",
});
```

## Built-in Tools

Here are the built-in tools that Agentbase agents have access to:

| Category                    | Tool                 | Description                                                                 |
| --------------------------- | -------------------- | --------------------------------------------------------------------------- |
| **File System**             | `str_replace_editor` | Create, edit, view, and manage files with persistent state across sessions  |
|                             | `bash`               | Run shell commands with internet access and package management capabilities |
|                             | `glob`               | Find files using glob patterns (e.g., `*.js`, `**/*.ts`)                    |
|                             | `grep`               | Search for text patterns in files with regex support                        |
| **Web Tools**               | `web` (search)       | Search the web for real-time information and current data                   |
|                             | `web` (crawl)        | Extract content from specific URLs and websites                             |
| **Computer Environment**    | `computer`           | Create/resume Linux computer instances for development tasks                |
| **Thinking & Planning**     | `think`              | Private scratchpad for complex reasoning, planning, and maintaining context |
| **Development Environment** | Python 3.11.2        | Execute Python code and scripts                                             |
|                             | Node.js 18.20.4      | JavaScript runtime environment                                              |
|                             | Package management   | apt (Debian), pip (Python), npm (Node.js)                                   |

## Example Tool Event Flow

When agents use tools, the API streams real-time events showing tool execution:

```json theme={null}
// Tool execution starts
{"type": "agent_tool_use", "content": "{\"tool\":\"web\",\"input\":\"{\\\"command\\\":\\\"search\\\",\\\"query\\\":\\\"AI developments 2025\\\"}\"}"}

// Tool returns results
{"type": "agent_tool_response", "content": "{\n  \"tool\": \"web\",\n  \"response\": [\n    {\n      \"url\": \"https://example.com/ai-news\",\n      \"title\": \"Latest AI Developments\"\n    }\n  ]\n}"}

// Cost tracking
{"type": "agent_cost", "session": "abc123", "cost": "0.0095", "balance": 47.45}

// Step completion
{"type": "agent_step", "session": "abc123", "stepNumber": 1}
```

## Custom Tools

You can write custom code tools with environment variables in the Agentbase app's Tools section:

<img src="https://mintcdn.com/pointer-a6b7b4cd/vPW4n-M0vJAdiQQn/images/tools.png?fit=max&auto=format&n=vPW4n-M0vJAdiQQn&q=85&s=7b9808d462367d78d28a7d19615b0a51" alt="Custom tools interface showing code editor with environment variables" width="1484" height="860" data-path="images/tools.png" />

```typescript theme={null}
// Example custom tool usage
const result = await agentbase.runAgent({
  message: "Get customer data for user ID 12345",
  tools: ["get_customer_data"], // deployed tool name on the agentbase app
});
```

## Key Points

* Tools are selected automatically based on your task
* No manual configuration or tool specification required
* Computer environments created when needed for stateful operations
* All tools work together seamlessly in workflows
