Tools Reference
Forge provides a comprehensive set of built-in tools that enable AI agents to interact with your system, manage files, process data, and communicate with users. This reference documents all available tools and their parameters.
Note: These tools are used internally by Forge's AI agents and are not meant to be directly called by developers. This reference is provided for understanding what capabilities agents have access to within your system.
File System Tools
read
Reads file contents at a specified path.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Absolute path to the file |
write
Creates or overwrites a file with specified content.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Absolute path to the file |
content | string | Yes | Content to write to the file |
overwrite | boolean | No | Whether to overwrite if file exists (default: false) |
patch
Modifies files with targeted text operations on matched patterns.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Absolute path to the file |
patches | array | Yes | List of patch operations to apply |
Patch Operations
Operation | Description |
---|---|
prepend | Add content before the matched text |
append | Add content after the matched text |
replace | Replace the matched text with new content |
swap | Exchange the matched text with another text |
remove
Removes a file at a specified path.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Absolute path to the file |
search
Searches for text patterns across files using regex.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Directory to search in (recursively) |
regex | string | Yes | Regular expression pattern to search for |
file_pattern | string | No | Glob pattern to filter files (e.g., "*.js") |
undo
Reverts the most recent file operation on a specific file.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path | string | Yes | Absolute path of the file to revert |
Network Tools
fetch
Retrieves content from URLs as markdown or raw text.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
url | string | Yes | URL to fetch content from |
raw | boolean | No | Whether to return raw content instead of markdown (default: false) |
max_length | number | No | Maximum characters to return (default: 40000) |
start_index | number | No | Starting character index for pagination (default: 0) |
Process Tools
shell
Executes shell commands with safety measures.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
command | string | Yes | Shell command to execute |
cwd | string | Yes | Working directory for command execution |
Completion Tool
attempt_completion
Presents the result of the task to the user.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
result | string | Yes | The task result |