Edit Files In Place
edit_filesChange PART of a file without resending it — the counterpart to write_files. Give old_string (exact text as in the file today) and new_string; Kleap reads, replaces, stores. Nothing else moves. Use it whenever the file exists and only a line, block or URL changes: resending a 30KB layout to fix one line wastes tokens and risks corrupting the rest. read_files first, copy the text EXACTLY. old_string must appear once — otherwise the error names the count; add context or pass replace_all:true. Edits are validated together: if any is invalid, nothing is written. Across files the writes are sequential — a late failure names what was already applied. new_string "" deletes the match. Not for new files or binaries. Then publish_app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | Edits, in order. Validated before any write. | |
| app_id | Yes | The app ID | |
| context | Yes | Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | ||
| paths | No | ||
| app_id | No | ||
| edited | No |