Skip to main content

Overview

Avante.nvim provides a comprehensive set of tools that AI agents can use during code generation and analysis. These tools enable agents to read files, execute commands, search code, and perform various development tasks.
Tools are enabled by default in agentic mode. You can disable them globally or selectively per provider.

Available Tools

Here’s the complete list of available tools:

File Operations

Read the contents of a file.Usage: The AI can read any file in your project to understand context or analyze code.Example: “Read the authentication module to understand the login flow.”
Read top-level symbols (functions, classes, etc.) from a file without reading the entire content.Usage: Quickly scan file structure without loading full content.Example: “What classes are defined in user.py?”
Create a new file with specified content.Usage: Generate new files based on requirements.Example: “Create a new test file for the authentication module.”
Edit an existing file (used with Fast Apply feature).Usage: Apply precise code modifications.Example: “Update the login function to add rate limiting.”
Delete a file or directory.Usage: Remove obsolete files or directories.Example: “Remove the old migration files.”
Move or rename a file or directory.Usage: Reorganize project structure.Example: “Move the utility functions to a utils folder.”
Copy a file or directory.Usage: Duplicate files or create templates.Example: “Copy the base controller to create a new API controller.”
Create a new directory.Usage: Set up new directory structures.Example: “Create a components directory for React components.”

Search Operations

Search for files using glob patterns.Usage: Find files matching specific patterns.Example: “Find all TypeScript test files.”Pattern Examples:
  • **/*.ts - All TypeScript files
  • src/**/*.test.js - All test files in src
Search for keywords in file contents using regex.Usage: Find specific code patterns or text.Example: “Find all usages of the deprecated API.”

Execution Tools

Execute bash commands.Usage: Run shell commands, scripts, or build tools.Example: “Run the test suite to verify the changes.”
This tool can execute arbitrary commands. Review permissions carefully.
Execute Python code.Usage: Run Python scripts or perform data analysis.Example: “Analyze the log file and extract error patterns.”
Can execute arbitrary Python code. Use with caution.

Git Operations

Show git diff of changes.Usage: Review uncommitted changes.Example: “What changes have been made since the last commit?”
Create a git commit.Usage: Commit changes with an AI-generated message.Example: “Commit these authentication improvements.”

Web Operations

Fetch content from a URL.Usage: Retrieve web content or API responses.Example: “Fetch the API documentation from the endpoint.”

Disabling Tools

Disable All Tools

To disable all tools for a provider:
require('avante').setup({
  providers = {
    claude = {
      endpoint = "https://api.anthropic.com",
      model = "claude-sonnet-4-20250514",
      disable_tools = true, -- Disable all tools
    },
  },
})
Some LLM models don’t support tools. Disable them if you encounter errors.

Disable Specific Tools

To disable only certain tools:
require('avante').setup({
  disabled_tools = { "python", "bash" }, -- Disable specific tools
})
If Claude 3.7 is overusing the Python tool, add it to disabled_tools to prevent its usage.

Common Use Cases for Disabling

Disable execution tools in sensitive environments:
disabled_tools = { "bash", "python", "delete_path" }
Disable web-related tools:
disabled_tools = { "web_search", "fetch" }
Disable all modification tools:
disabled_tools = {
  "create_file", "edit_file", "delete_path",
  "move_path", "copy_path", "create_dir",
  "git_commit", "bash", "python"
}

Tool Permissions

Control how tools are approved:
require('avante').setup({
  behaviour = {
    auto_approve_tool_permissions = true, -- Auto-approve all tools
    -- OR
    auto_approve_tool_permissions = { "bash", "str_replace" }, -- Specific tools only
    -- OR  
    auto_approve_tool_permissions = false, -- Show prompts for all tools
  },
})

Permission Modes

behaviour = {
  auto_approve_tool_permissions = true,
}
All tools are automatically approved without prompting.Use when: You trust the AI completely and want maximum automation.

Confirmation UI Style

Choose how permission prompts are displayed:
require('avante').setup({
  behaviour = {
    confirmation_ui_style = "inline_buttons", -- or "popup"
  },
})

Custom Tools

You can define your own custom tools:
require('avante').setup({
  custom_tools = {
    {
      name = "run_go_tests",
      description = "Run Go unit tests and return results",
      command = "go test -v ./...",
      param = {
        type = "table",
        fields = {
          {
            name = "target",
            description = "Package or directory to test",
            type = "string",
            optional = true,
          },
        },
      },
      returns = {
        {
          name = "result",
          description = "Test results",
          type = "string",
        },
        {
          name = "error",
          description = "Error message if test failed",
          type = "string",
          optional = true,
        },
      },
      func = function(params, on_log, on_complete)
        local target = params.target or "./..."
        return vim.system({ "go", "test", "-v", target }, { text = true }):wait().stdout
      end,
    },
  },
})

Custom Tool Example: Database Query

custom_tools = {
  {
    name = "query_database",
    description = "Execute SQL query and return results",
    param = {
      type = "table",
      fields = {
        {
          name = "query",
          description = "SQL query to execute",
          type = "string",
        },
      },
    },
    func = function(params)
      -- Your database query logic here
      return "Query results..."
    end,
  },
}

Tool Usage in Agentic Mode

In agentic mode, the AI automatically uses tools to complete tasks:
1

Task Analysis

The AI analyzes your request and determines which tools are needed.
2

Tool Selection

Based on the task, the AI selects appropriate tools (read_file, bash, etc.).
3

Permission Check

If auto-approval is disabled, you’re prompted to approve the tool usage.
4

Execution

The tool is executed and results are returned to the AI.
5

Iteration

The AI may use additional tools based on the results until the task is complete.

Legacy Mode (No Tools)

To use the old planning method without tools:
require('avante').setup({
  mode = "legacy", -- Disable agentic mode and tools
})
See the Modes documentation for more information on agentic vs legacy mode.

Best Practices

Security First

Carefully review which tools are auto-approved, especially bash and python.

Selective Disabling

Disable tools you don’t need to reduce security surface area.

Monitor Usage

Watch which tools the AI uses to understand its decision-making process.

Custom Tools

Create custom tools for project-specific operations to enhance AI capabilities.

ACP Support

Agent Client Protocol integration

Agentic Workflow

Understanding autonomous agents

Web Search

Configure web search tools

Build docs developers (and LLMs) love