|
| 1 | +# Autonomous Looper Tools Configuration |
| 2 | + |
| 3 | +The `selected_tools` parameter allows you to configure which tools are available to the agent when using the autonomous looper mode (`max_loops="auto"`). |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +When an agent is set to `max_loops="auto"`, it enters autonomous loop mode where it can: |
| 8 | +1. Create a plan by breaking down tasks into subtasks |
| 9 | +2. Execute each subtask using available tools |
| 10 | +3. Generate a comprehensive summary when complete |
| 11 | + |
| 12 | +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"`). |
| 13 | + |
| 14 | +## Available Tools |
| 15 | + |
| 16 | +| Tool Name | Description | |
| 17 | +|-----------|-------------| |
| 18 | +| `create_plan` | Create a detailed plan for completing a task | |
| 19 | +| `think` | Analyze current situation and decide next actions | |
| 20 | +| `subtask_done` | Mark a subtask as completed and move to the next task | |
| 21 | +| `complete_task` | Mark the main task as complete with comprehensive summary | |
| 22 | +| `respond_to_user` | Send messages or responses to the user | |
| 23 | +| `create_file` | Create a new file with specified content | |
| 24 | +| `update_file` | Update an existing file (replace or append) | |
| 25 | +| `read_file` | Read the contents of a file | |
| 26 | +| `list_directory` | List files and directories in a path | |
| 27 | +| `delete_file` | Delete a file (use with caution) | |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +### Default Behavior (All Tools Available) |
| 32 | + |
| 33 | +```python |
| 34 | +from swarms import Agent |
| 35 | + |
| 36 | +agent = Agent( |
| 37 | + agent_name="Full-Access-Agent", |
| 38 | + model_name="anthropic/claude-sonnet-4-5", |
| 39 | + max_loops="auto", |
| 40 | + selected_tools="all", # Default - all tools available |
| 41 | +) |
| 42 | +``` |
| 43 | + |
| 44 | +### Restricted Tools |
| 45 | + |
| 46 | +```python |
| 47 | +agent = Agent( |
| 48 | + agent_name="Planning-Only-Agent", |
| 49 | + model_name="anthropic/claude-sonnet-4-5", |
| 50 | + max_loops="auto", |
| 51 | + selected_tools=[ |
| 52 | + "create_plan", |
| 53 | + "think", |
| 54 | + "subtask_done", |
| 55 | + "complete_task", |
| 56 | + "respond_to_user", |
| 57 | + ], |
| 58 | +) |
| 59 | +``` |
| 60 | + |
| 61 | +### File Operations Enabled |
| 62 | + |
| 63 | +```python |
| 64 | +agent = Agent( |
| 65 | + agent_name="File-Operations-Agent", |
| 66 | + model_name="anthropic/claude-sonnet-4-5", |
| 67 | + max_loops="auto", |
| 68 | + selected_tools=[ |
| 69 | + "create_plan", |
| 70 | + "think", |
| 71 | + "subtask_done", |
| 72 | + "complete_task", |
| 73 | + "respond_to_user", |
| 74 | + "create_file", |
| 75 | + "update_file", |
| 76 | + "read_file", |
| 77 | + "list_directory", |
| 78 | + ], |
| 79 | +) |
| 80 | +``` |
| 81 | + |
| 82 | +### Minimal Configuration |
| 83 | + |
| 84 | +```python |
| 85 | +agent = Agent( |
| 86 | + agent_name="Minimal-Agent", |
| 87 | + model_name="anthropic/claude-sonnet-4-5", |
| 88 | + max_loops="auto", |
| 89 | + selected_tools=[ |
| 90 | + "create_plan", |
| 91 | + "subtask_done", |
| 92 | + "complete_task", |
| 93 | + ], |
| 94 | +) |
| 95 | +``` |
| 96 | + |
| 97 | +## Use Cases |
| 98 | + |
| 99 | +### Research Agent (No File Operations) |
| 100 | +For agents focused on research and analysis without needing to create or modify files: |
| 101 | + |
| 102 | +```python |
| 103 | +research_agent = Agent( |
| 104 | + agent_name="Research-Agent", |
| 105 | + max_loops="auto", |
| 106 | + selected_tools=[ |
| 107 | + "create_plan", |
| 108 | + "think", |
| 109 | + "subtask_done", |
| 110 | + "complete_task", |
| 111 | + "respond_to_user", |
| 112 | + ], |
| 113 | +) |
| 114 | +``` |
| 115 | + |
| 116 | +### Code Generation Agent (With File Operations) |
| 117 | +For agents that need to create and modify code files: |
| 118 | + |
| 119 | +```python |
| 120 | +code_agent = Agent( |
| 121 | + agent_name="Code-Generator", |
| 122 | + max_loops="auto", |
| 123 | + selected_tools=[ |
| 124 | + "create_plan", |
| 125 | + "think", |
| 126 | + "subtask_done", |
| 127 | + "complete_task", |
| 128 | + "respond_to_user", |
| 129 | + "create_file", |
| 130 | + "update_file", |
| 131 | + "read_file", |
| 132 | + "list_directory", |
| 133 | + ], |
| 134 | +) |
| 135 | +``` |
| 136 | + |
| 137 | +### Data Analysis Agent (Read-Only Files) |
| 138 | +For agents that need to read files but shouldn't modify them: |
| 139 | + |
| 140 | +```python |
| 141 | +analysis_agent = Agent( |
| 142 | + agent_name="Data-Analyst", |
| 143 | + max_loops="auto", |
| 144 | + selected_tools=[ |
| 145 | + "create_plan", |
| 146 | + "think", |
| 147 | + "subtask_done", |
| 148 | + "complete_task", |
| 149 | + "respond_to_user", |
| 150 | + "read_file", |
| 151 | + "list_directory", |
| 152 | + ], |
| 153 | +) |
| 154 | +``` |
| 155 | + |
| 156 | +## Best Practices |
| 157 | + |
| 158 | +1. **Start Restrictive**: Begin with a minimal set of tools and add more as needed |
| 159 | +2. **Security**: Avoid giving file deletion capabilities unless absolutely necessary |
| 160 | +3. **Task Alignment**: Choose tools that align with the agent's primary purpose |
| 161 | +4. **Testing**: Test your agent with the tool configuration before production use |
| 162 | + |
| 163 | +## Notes |
| 164 | + |
| 165 | +- `selected_tools` defaults to `"all"`, which enables all tools |
| 166 | +- When set to a list, the agent will only have access to the tools you specify |
| 167 | +- Tool handlers are automatically filtered based on your configuration |
| 168 | +- Invalid tool names are ignored (only valid tool names from the list above are used) |
| 169 | + |
| 170 | +## See Also |
| 171 | + |
| 172 | +- [Autonomous Loop Documentation](./autonomous_loop.md) |
| 173 | +- [Agent Configuration Guide](./agent_configuration.md) |
| 174 | +- [Tool System Overview](./tools.md) |
0 commit comments