sftp_patch_file
Atomically replaces a target text block in a remote file via SFTP using anchor-based matching, preventing full-file overwrites and line number drift.
Instructions
对远程大文本文件实施精准锚点文本块原子化替换,杜绝整文件覆写与行号漂移风险
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remotePath | Yes | 远程文件绝对路径(必须以 '/' 开头) | |
| connectionId | No | 目标连接标识符,缺省时使用当前默认连接 | |
| allowMultiple | No | 当目标文本块在文件中存在多处匹配时是否全部替换,默认 false(要求唯一匹配以防误伤) | |
| targetContent | Yes | 待在远程文件中寻找并替换的精确目标文本块 | |
| replacementContent | Yes | 替换后的新文本内容 |