Delete Files
delete_filesRemove pages, components or assets from a site — the counterpart to write_files. Use it when a page should no longer exist: a wrong route, a duplicate, an outdated landing page, an image nobody references. Do NOT overwrite the file with empty content instead: that leaves a URL answering 200 with nothing, which is worse for SEO than a clean 404. Deleting a binary also removes its stored bytes. Paths Kleap owns (astro.config.mjs, package.json, tsconfig.json…) are refused — the build lays its own copy back down, so removing them changes nothing. The homepage (src/pages/index.astro) is refused too: a site with no homepage is broken — write a new one instead, writing replaces it. Returns which paths were actually deleted and which did not exist. The pages STAY LIVE until you call publish_app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Project-relative paths to delete, e.g. ["src/pages/old.astro", "public/images/unused.png"] | |
| 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 |
|---|---|---|---|
| app_id | No | ||
| deleted | No | ||
| missing | No |