Skip to content
IbrahimAzab edited this page Jan 10, 2026 · 1 revision

🔧 Tool System

Maestro V2 includes an extensible tool system that agents can use to perform actions.


Available Tools

Tool Description Used By
file_read Read file contents All agents
file_write Write to files Developer, Docs
file_list List directory All agents
web_search DuckDuckGo search Research
code_executor Run Python code Developer

📂 File Tools

file_read

Reads the contents of a file.

result = await file_read.execute(file_path="/path/to/file.txt")
# Returns: {"content": "file contents...", "size": 1234}

file_write

Writes content to a file. Creates directories if needed.

result = await file_write.execute(
    file_path="/path/to/file.txt",
    content="Hello, World!"
)

file_list

Lists files and directories.

result = await file_list.execute(directory="/path/to/dir")
# Returns: {"items": [...], "count": 10}

🔍 Web Search

Searches the web using DuckDuckGo.

result = await web_search.execute(
    query="FastAPI best practices",
    num_results=5
)
# Returns: {"results": [{"title": "...", "snippet": "...", "url": "..."}]}

⚡ Code Executor

Executes Python code in a sandboxed environment.

Safety Features:

  • 30-second timeout
  • Restricted builtins
  • No network access
  • No file system access outside sandbox
result = await code_executor.execute(
    code="print('Hello from sandbox!')",
    language="python"
)
# Returns: {"stdout": "Hello from sandbox!", "exit_code": 0}

Creating Custom Tools

Extend BaseTool to create your own tools:

from tools import BaseTool, ToolResult

class MyCustomTool(BaseTool):
    name = "my_tool"
    description = "Does something useful"
    
    async def execute(self, **kwargs) -> ToolResult:
        # Your logic here
        return ToolResult(success=True, data={"result": "done"})

← Agents | Configuration →

Clone this wiki locally