Tools allow the LLM to perform actions in your codebase. OpenCode comes with a set of built-in tools, but you can extend it with [custom tools](/docs/custom-tools) or [MCP servers](/docs/mcp-servers).
This tool is only available when using the OpenCode provider or when the `OPENCODE_ENABLE_EXA` environment variable is set to any truthy value (e.g., `true` or `1`).
To enable when launching OpenCode:
```bash
OPENCODE_ENABLE_EXA=1 opencode
```
:::
```json title="opencode.json" {4}
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"websearch": "allow"
}
}
```
Performs web searches using Exa AI to find relevant information online. Useful for researching topics, finding current events, or gathering information beyond the training data cutoff.
No API key is required — the tool connects directly to Exa AI's hosted MCP service without authentication.
:::tip
Use `websearch` when you need to find information (discovery), and `webfetch` when you need to retrieve content from a specific URL (retrieval).
This tool allows the LLM to ask the user questions during a task. It's useful for:
- Gathering user preferences or requirements
- Clarifying ambiguous instructions
- Getting decisions on implementation choices
- Offering choices about what direction to take
Each question includes a header, the question text, and a list of options. Users can select from the provided options or type a custom answer. When there are multiple questions, users can navigate between them before submitting all answers.
Custom tools let you define your own functions that the LLM can call. These are defined in your config file and can execute arbitrary code.
[Learn more](/docs/custom-tools) about creating custom tools.
---
## MCP servers
MCP (Model Context Protocol) servers allow you to integrate external tools and services. This includes database access, API integrations, and third-party services.
[Learn more](/docs/mcp-servers) about configuring MCP servers.
---
## Internals
Internally, tools like `grep`, `glob`, and `list` use [ripgrep](https://github.com/BurntSushi/ripgrep) under the hood. By default, ripgrep respects `.gitignore` patterns, which means files and directories listed in your `.gitignore` will be excluded from searches and listings.
To include files that would normally be ignored, create a `.ignore` file in your project root. This file can explicitly allow certain paths.
```text title=".ignore"
!node_modules/
!dist/
!build/
```
For example, this `.ignore` file allows ripgrep to search within `node_modules/`, `dist/`, and `build/` directories even if they're listed in `.gitignore`.