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

# Tools

> Zeus Tool System

## Built-in Tools

Zeus's tool system is organized into four layers, each serving a different capability domain:

```mermaid theme={null}
graph TD
    subgraph L1["Layer 1 · DeepAgents Middleware"]
        todo["TodoListMiddleware<br/>write_todos · read_todos"]
        fs["FilesystemMiddleware<br/>ls · read_file · write_file<br/>edit_file · glob · grep"]
        subagent["SubAgentMiddleware<br/>task (SubAgent delegation)"]
    end

    subgraph L2["Layer 2 · Built-in Tools"]
        memory_tools["Memory Tools<br/>memory_add · memory_search"]
        rag_tools["RAG Tools<br/>knowledge_search<br/>knowledge_read_chunks"]
        sandbox_tools["Sandbox Tools<br/>write · read · edit · bash"]
        lsp_tools["LSP Tools<br/>lsp (diagnostics · definition<br/>references · hover · symbols)"]
        coding_tools["Coding Sandbox Tools<br/>coding_write_file · coding_read_file<br/>coding_grep · coding_exec_sh<br/>coding_list_files"]
        web_tools["Web Search Tools<br/>tavily_search · duckduckgo_search"]
        skill_tools["Skill Tools<br/>skill_discover · skill_activate<br/>skill_execute"]
    end

    subgraph L3["Layer 3 · External Tools"]
        mcp_tools["MCP Tools<br/>User-configured MCP servers"]
        oauth_tools["OAuth Tools<br/>GitHub · Gmail · Google Drive"]
    end

    subgraph L4["Layer 4 · Connector Tools"]
        browser["Browser Operator<br/>Browser automation"]
        desktop["Desktop Operator<br/>Desktop application control"]
        feishu["Feishu Tools<br/>Feishu calendar/meetings"]
    end

    L1 --> L2 --> L3 --> L4
```

### Tool Injection & Mode Filtering

Tools are loaded sequentially during `_init_context()`, with different tool sets available per mode:

| Tool Category               | Agent Mode | Ask Mode                | Plan Mode | Coding Mode |
| --------------------------- | ---------- | ----------------------- | --------- | ----------- |
| Filesystem (read/write)     | All        | Read-only               | Read-only | Disabled    |
| TodoList                    | All        | All                     | All       | All         |
| Memory                      | Read/write | Disabled                | Read-only | Read/write  |
| RAG                         | All        | Read-only (search/list) | All       | All         |
| Sandbox (Python)            | All        | Disabled                | Disabled  | Disabled    |
| **LSP (Code Intelligence)** | All        | Disabled                | Disabled  | Disabled    |
| **Coding Sandbox**          | Disabled   | Disabled                | Disabled  | **All**     |
| Web Search                  | All        | All                     | All       | All         |
| MCP/OAuth                   | All        | Read-only               | Read-only | All         |
| Browser/Desktop             | All        | Disabled                | Disabled  | Disabled    |

<Note>
  Coding Mode uses a dedicated set of sandbox tools (`coding_*`) that operate on a Next.js project inside an E2B container. See the [Coding Mode](/en/documentation/core-capabilities/coding) page for details.
</Note>

In Ask mode, write tools are replaced with placeholders — the Agent knows the tools exist but cannot call them, and guides the user to switch to Agent mode (progressive disclosure).

MCP tools are loaded via `MultiServerMCPClient`, with each server having a 1800s (30min) timeout.

***

## TODO State Flow

### Overview

TodoList is a built-in middleware tool from the DeepAgents framework, managing task state through `write_todos` and `read_todos`.

### Background

In real-time chat and history replay, the `todo.md` state needs to be correctly updated. Previously, there was a bug where `sandbox` tool calls would overwrite the `todo.md` content.

### Data Flow

```mermaid theme={null}
flowchart TD
    A["AI Backend - SSE Events"] --> B["stream-processor.ts"]
    B --> C["Parse events"]
    C --> D["trajectoryStore.ts"]
    D --> E["Update state"]
    E --> F["UI Components - TrajectoryArea"]
```

### Key Fix

The file list returned by `sandbox` calls would overwrite the `todo.md` content previously set by `write_todos`. The solution is to check during state updates whether the existing `todo.md` content should be preserved. If the newly returned file list does not contain an updated version of `todo.md`, the content previously set by `write_todos` is retained, preventing it from being overwritten.

***

## MCP Prompts

### Overview

Zeus supports MCP (Model Context Protocol) **Prompts** functionality. In addition to `@mcp.tools`, MCP server-provided prompt templates can be accessed via `@mcp.prompts`.

### What are MCP Prompts

MCP Prompts are **reusable prompt templates** provided by MCP servers, similar to preset conversation scenarios or workflows.

**Tools vs Prompts**:

| Feature    | Tools                       | Prompts                |
| ---------- | --------------------------- | ---------------------- |
| Purpose    | Execute specific operations | Provide preset prompts |
| Examples   | Search, file reading        | Code review template   |
| Invocation | Agent calls automatically   | User selects to use    |

### Architecture

The system initializes MCP Prompts via BaseService, iterating through all configured MCP servers to retrieve each server's prompt list (including name, description, and parameter information).

The API validation endpoint `/validate` returns both tool and prompt information. MCP server records in the database contain `tools` and `prompts` JSON fields.

### Usage

#### Method 1: As Prompt Template Resources

Users can select a prompt in the UI and fill in parameters. The system will retrieve the corresponding prompt content based on the selected prompt and parameters.

#### Method 2: Dynamic Invocation

The AI can identify when a prompt template is needed and dynamically retrieve prompt content by specifying the server name, prompt name, and parameters.

***

## Official Tools

### Overview

Zeus AI provides a set of pre-configured official tools that can be directly enabled and used in the MCP tab.

### Available Tools

#### Tavily Search

**AI-powered web search engine**

* **Function**: Search the internet using AI technology
* **Use Cases**: Find real-time information, news, research materials
* **Requires API Key**: Yes
* **Get API Key**: [https://tavily.com](https://tavily.com)
* **Default Enabled**: Yes

#### GitHub

**GitHub repository and code search**

* **Function**: Search GitHub repositories, view code, get user information
* **Use Cases**: Find open-source projects, research code implementations
* **Requires API Key**: Yes (recommended)
* **Get API Key**: GitHub Personal Access Token
* **Default Enabled**: No

### Usage Guide

#### Enabling Official Tools

1. Open the tool configuration panel
2. Select the "MCP" tab
3. Find the tool you need in the "Official Tools" area
4. Click the toggle switch on the tool card to enable it

#### Configuring API Keys

1. Click the "Configure API Key" button on the tool card
2. Enter the API Key
3. The API Key will be securely encrypted and stored
4. The tool will be automatically enabled

### API Endpoints

* `GET /api/skills/official` - Get list of all available official tools
* `GET /api/skills/official/[name]` - Get details of a specific official tool
* `POST /api/tools/mcp/validate` - Validate MCP server connection
