Skip to main content

Overview

The Tools API allows you to register custom tools that agents can use during execution. Tools can run locally or in the sandboxed environment.

Tool Registration

register_tool

Decorator to register a function as a tool available to agents.
Callable
required
The function to register as a tool
bool
default:"True"
Whether the tool should execute inside the sandbox
Example:

Tool Execution

execute_tool

Executes a tool by name with the provided arguments.
str
required
Name of the tool to execute
AgentState | None
Agent state if the tool requires it
Any
Tool-specific arguments
Any
Tool execution result
Example:

execute_tool_with_validation

Executes a tool with parameter validation.
str | None
required
Name of the tool to execute
AgentState | None
Agent state if required
Any
Tool arguments
Any
Tool result or error message
Example:

process_tool_invocations

Processes multiple tool invocations from the LLM response.
list[dict[str, Any]]
required
List of tool invocation dictionaries
list[dict[str, Any]]
required
Conversation history to append results to
AgentState | None
Agent state
bool
True if agent should finish execution

Tool Registry

get_tool_by_name

Retrieves a tool function by name.
str
required
Tool name
Callable[..., Any] | None
Tool function or None if not found

get_tool_names

Returns a list of all registered tool names.
list[str]
List of tool names

needs_agent_state

Checks if a tool requires agent_state parameter.
str
required
Name of the tool
bool
True if tool needs agent_state

Built-in Tools

Strix includes several built-in tools:

File Operations

str_replace_editor - Edit files using view, create, str_replace, insert commands list_files - List files and directories search_files - Search file contents using regex

Terminal

terminal_execute - Execute shell commands in the sandbox

Browser

browser_action - Control a headless browser (launch, goto, click, type, etc.)

Python

python_execute - Execute Python code in an isolated REPL

Agent Management

create_subagent - Create a sub-agent for delegating tasks send_message - Send messages between agents wait_for_message - Wait for messages from other agents agent_finish - Mark sub-agent as completed

Completion

finish_scan - Complete the scan and return results

Custom Tool Example

Error Handling

Tools should return error information in a consistent format:
The agent will receive error results and can handle them appropriately.