Skip to main content
The selected_tools parameter allows you to configure which tools are available to the agent when using the autonomous looper mode (max_loops="auto").

Overview

When an agent is set to max_loops="auto", it enters autonomous loop mode where it can:
  1. Create a plan by breaking down tasks into subtasks
  2. Execute each subtask using available tools
  3. Generate a comprehensive summary when complete
The selected_tools parameter gives you fine-grained control over which tools the agent can use during this autonomous execution. By default, all tools are enabled (selected_tools="all").

Available Tools

Usage

Default Behavior (All Tools Available)

Restricted Tools

File Operations Enabled

File Operations + Terminal (run_bash)

Enable file operations and terminal command execution:

Minimal Configuration

Use Cases

Research Agent (No File Operations)

For agents focused on research and analysis without needing to create or modify files:

Code Generation Agent (With File Operations)

For agents that need to create and modify code files:

Data Analysis Agent (Read-Only Files)

For agents that need to read files but shouldn’t modify them:

Terminal / DevOps Agent (With run_bash)

For agents that need to run shell commands (e.g. scripts, CLI tools, git):
See Run Bash Tool Tutorial for a step-by-step guide.

Best Practices

  1. Start Restrictive: Begin with a minimal set of tools and add more as needed
  2. Security: Avoid giving file deletion capabilities unless absolutely necessary
  3. Task Alignment: Choose tools that align with the agent’s primary purpose
  4. Testing: Test your agent with the tool configuration before production use

Notes

  • selected_tools defaults to "all", which enables all tools
  • When set to a list, the agent will only have access to the tools you specify
  • Tool handlers are automatically filtered based on your configuration
  • Invalid tool names are ignored (only valid tool names from the list above are used)

See Also