patch_file
Replace exact text occurrences in a file with new content using atomic writes. Returns the number of replacements made.
Instructions
Apply a targeted patch to a file.
Finds all occurrences of old_str and replaces them with new_str.
Uses atomic write. Returns the number of replacements made.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | Request model for patch_file tool. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path that was patched. | |
| new_size | Yes | File size after patch in bytes. | |
| old_size | Yes | File size before patch in bytes. | |
| replacements | Yes | Number of replacements made. |