Filesystem
v2.0.0Read, create, and edit files.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
view View
View file contents or list directory. For files: - Returns content with line numbers (format: " N\t<content>") - Use view_range to read specific lines [start, end] (1-indexed, inclusive) - Large files are truncated at 16000 characters For directories: - Lists contents with type indicator (/ for directories) - Shows 2 levels deep by default - Ignores hidden files and node_modules
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to file or directory |
view_range | array | Line range [start, end] for text files (1-indexed, inclusive) |
create Create
Create or overwrite a file with the specified content. - Creates parent directories if they don't exist - Overwrites existing files without warning - Use absolute paths
| Parameter | Type | Description |
|---|---|---|
content * | string | Content to write to the file |
path * | string | Absolute path where file will be created |
str_replace String Replace
Replace an exact string in a file. - old_str must match exactly and be unique in the file - If old_str appears 0 times or more than once, the operation fails - If new_str is omitted, old_str is deleted - Use absolute paths
| Parameter | Type | Description |
|---|---|---|
old_str * | string | Exact string to find (must be unique) |
path * | string | Absolute path to file |
new_str | string | Replacement string (omit to delete) |
insert Insert
Insert text at a specific line in a file. - insert_line = 0: Insert at the beginning - insert_line = N: Insert after line N - insert_line = -1: Insert at the end - insert_text should typically end with a newline - Use absolute paths
| Parameter | Type | Description |
|---|---|---|
insert_line * | integer | Line number to insert after (0 = beginning, -1 = end) |
insert_text * | string | Text to insert (should end with newline) |
path * | string | Absolute path to file |