Overview
Tool Name
Purpose
The filesystem_tools provide a comprehensive interface for local file and directory operations. Use them to read and write content, edit files by line, manage folders, search by name or content, visualize trees, and retrieve rich metadata for governance and troubleshooting.Functions Available
read_file: Read file content with automatic format detection and optional byte limit.read_text_file: Read text files with encoding and optional line numbering.edit_file: Modify files by replacing, inserting, appending, or deleting at line level.read_media_file: Access binary media content or metadata in safe formats.read_multiple_files: Batch read many files with optional shared encoding and metadata.write_file: Create or overwrite files with optional directory creation and encoding.directory_tree: Generate a visual tree of directories with depth control.create_directory: Create folders with optional recursion and permissions.list_allowed_directories: Show the directories your environment permits you to access.list_directory_with_sizes: List directory entries and compute sizes, optionally recursive.move_file: Move or rename files and directories with optional overwrite.search_files: Search by name, content, extension, or regex across a path.get_file_info: Return metadata such as size, timestamps, and permissions.list_directory: Basic listing of directory contents with optional filters.
Key Features
Read and Write
Reliable text and binary I/O with encoding control and safe byte limits.
Edit in Place
Line-level edits for quick fixes and scripted refactors.
Organize Folders
Create, move, and visualize directory structures.
Search at Scale
Find by name, content, or regex across nested trees.
Know Your Files
Retrieve permissions, timestamps, sizes, and checksums when needed.
Input Parameters for Each Function
read_file
Very large
read_file responses are capped before they are written into thread history. When the serialized response exceeds the file-read inline budget (default 262,144 bytes / 256 KB, configurable with GENESIS_TOOL_OUTPUT_FILE_READ_BUDGET), Genesis returns tool_output_capped, preview, truncation_info, full_output_ref, and agent_guidance instead of the full inline payload. Use start_byte, max_bytes, start_line, max_lines, end_byte, tail_bytes, or search_pattern to narrow follow-up reads. When full_output_ref is not null, the full text is saved under truncated_tool_outputs/<thread_id>/... in the apps BotGit repo and can be re-read with file(action="read", file_path=full_output_ref, repo_id="apps", start_byte=0, max_bytes=N), continuing from each response’s continuation.next_start_byte. The byte range is the shape that returns the saved copy exactly as written; the whole-file and line-window paths read in text mode and rewrite line endings.read_text_file
edit_file
For multi-line inserts or replaces, include newline characters in
new_content as needed.read_media_file
read_multiple_files
write_file
directory_tree
create_directory
list_allowed_directories
This function does not require parameters. It returns the set of directories that are safe to traverse in your environment.
list_directory_with_sizes
move_file
search_files
get_file_info
list_directory
Use Cases
- Config management
- Update YAML or JSON settings across environments with
read_text_fileandedit_file.
- Update YAML or JSON settings across environments with
- Log triage
- Sample the last megabytes of a large log using
read_filewithmax_bytes.
- Sample the last megabytes of a large log using
- Repo structuring
- Create a new project skeleton with
create_directoryand verify withdirectory_tree.
- Create a new project skeleton with
- Code search
- Find usages of a function name across a codebase with
search_filessearch_type: "content".
- Find usages of a function name across a codebase with
- Governance checks
- Pull
get_file_infowith checksums for release packaging or audit trails.
- Pull
Workflow/How It Works
- Inspect or search using
list_directory,list_directory_with_sizes, orsearch_files. - Read content with
read_text_fileorread_file. For binaries, useread_media_file. - Modify with
edit_fileor write new content withwrite_fileand optionalcreate_directories. - Restructure with
move_fileorcreate_directory, then visualize usingdirectory_tree. - Collect metadata using
get_file_infofor validation and documentation.
Integration Relevance
- file_manager_tools to register and attach files once created or modified.
- git_action for versioning changes that originate on the filesystem.
- document_index_tools to index folders after writing or reorganizing content.
- project_manager_tools to tie filesystem operations to tasks or milestones.
- artifact_manager_tools to track generated outputs and link them back to runs.
Configuration Details
- Use platform appropriate path separators and avoid trailing spaces in paths.
- Default encoding is UTF-8. Specify encodings explicitly when working with legacy files.
- For permission fields, use standard octal strings such as
755or644. - Recursive operations can be expensive on large trees. Apply
max_depthand filters.
Limitations or Notes
- All operations respect OS permissions and may fail without proper access.
- Large files can consume significant memory or time to process. Use limits and sampling.
- Network mounted volumes may perform differently than local disks.
- Encoding detection is best effort and may be inaccurate for mixed content files.
- Concurrent writers can cause conflicts. Coordinate long running edits and moves.
Output
- Reads: File content plus encoding info and optional metadata.
- Capped Oversized Read: When
read_fileis too large to keep inline,truncation_infoincludesbucket,bytes_in,bytes_out,budget_bytes, andspill_path. The sharedagent_guidanceexplains that this routine cap is not a context limit or an error; see Code Executor Tools — Output for the full spill and failed-save guidance. - Writes and Edits: Confirmation with file details and sizes.
- Listings: Entries with names, sizes, dates, and optional recursion summaries.
- Trees: A compact visual structure of folders and files.
- Search: Array of matches with paths and match context.
- Metadata: Permissions, timestamps, and checksums when requested.

