files_update
Updates a knowledge-base file or a single heading section, writes changes locally, and re-indexes content for full-text search.
Instructions
Rewrite a KB file (project-repo files are refused: kxta never writes into a repo). Default = full-body replacement: content becomes the entire file, triggering disk write + FTS5 re-index. Pass section to instead rewrite ONLY that heading's body (case-insensitive exact-string after trim; the heading line itself is preserved, siblings untouched), saves context budget vs resending the whole file. Throws if section is set but the heading doesn't exist (this mode will NOT create a new section, append the section text via a full-body update first). Operates locally with no external auth or rate limits. Returns the updated file metadata including new estimated token counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | File ID | |
| content | Yes | New content. With `section` set, this replaces just that heading's body; otherwise it becomes the entire file body. | |
| section | No | Case-insensitive exact-string heading. When set, only this heading's body is rewritten instead of the whole file. |