Skip to main content

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

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the file

write

Creates or overwrites a file with specified content.

Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the file
contentstringYesContent to write to the file
overwritebooleanNoWhether to overwrite if file exists (default: false)

patch

Modifies files with targeted text operations on matched patterns.

Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the file
patchesarrayYesList of patch operations to apply

Patch Operations

OperationDescription
prependAdd content before the matched text
appendAdd content after the matched text
replaceReplace the matched text with new content
swapExchange the matched text with another text

remove

Removes a file at a specified path.

Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the file

Searches for text patterns across files using regex.

Parameters

ParameterTypeRequiredDescription
pathstringYesDirectory to search in (recursively)
regexstringYesRegular expression pattern to search for
file_patternstringNoGlob pattern to filter files (e.g., "*.js")

undo

Reverts the most recent file operation on a specific file.

Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute path of the file to revert

Network Tools

fetch

Retrieves content from URLs as markdown or raw text.

Parameters

ParameterTypeRequiredDescription
urlstringYesURL to fetch content from
rawbooleanNoWhether to return raw content instead of markdown (default: false)
max_lengthnumberNoMaximum characters to return (default: 40000)
start_indexnumberNoStarting character index for pagination (default: 0)

Process Tools

shell

Executes shell commands with safety measures.

Parameters

ParameterTypeRequiredDescription
commandstringYesShell command to execute
cwdstringYesWorking directory for command execution

Completion Tool

attempt_completion

Presents the result of the task to the user.

Parameters

ParameterTypeRequiredDescription
resultstringYesThe task result