read_file
Read the text content of a file. Provide a relative path (e.g. 'src/main.rs' or 'README.md'). Returns the file's content as a UTF-8 string. Use offset (1-indexed) and limit to read a specific range of lines.
write_file
Write text content to a file. Provide a relative path (e.g. 'src/main.rs') and the full UTF-8 content to write. Creates the file if it does not exist, or overwrites it entirely if it does. If the file already exists, it must be read first — attempting to overwrite without a prior read will return an error. Set 'createdirs' to true to create any missing intermediate directories automatically. To create a directory without writing a file, end the path with '/' (e.g. 'src/utils/') and set 'createdirs' to true — content is ignored in that case.
edit_file
Replace text within a file. Reads the file, finds the exact string provided in 'oldstring', and replaces it with 'newstring'. By default the string must appear exactly once — include enough surrounding context in 'oldstring' to make it unique. If the string appears multiple times and you want to replace all of them, set replaceall to true. Always read the file before editing to ensure 'old_string' matches the current content exactly.
move
Move or rename a file or directory, or delete it. Provide 'src' (source) and 'dst' (destination) to move or rename. If 'dst' already exists and 'overwrite' is false (default), the call fails — set 'overwrite' to true to replace it. Set 'create_dirs' to true to create any missing intermediate directories for the destination. To delete instead of moving, omit 'dst' and set 'delete' to true.
glob
List files matching a glob pattern. Returns a newline-separated list of relative file paths sorted alphabetically. Use ` to match across directories (e.g. /.rs finds all Rust files, src//.ts` finds TypeScript files under src/). Use 'max_results' to control the result cap (default 300; 0 = unlimited).
grep
Search file contents for a regex pattern (ripgrep). Returns matching lines with their file path and line number. Use 'glob' to restrict the search to specific file types (e.g. '/*.rs'). Use 'contextlines' to include N surrounding lines around each match. Use 'maxmatches' to control the result cap (default 100; 0 = unlimited).
fetch
Perform an HTTP request and return the response body as text. The URL must use the http or https scheme. Available methods and domains are determined by the sandbox configuration.
js_repl
Evaluate JavaScript code and return the result as a string. The session is persistent: variables and functions defined in one call are available in subsequent calls.
js_exec
Execute a JavaScript file in a fresh runtime and return an empty string on success, or an error message if the script throws. No state is shared with the JS REPL — each call starts from a clean context.