Delete a page
delete_pageDeletes a page the way the Pages panel does, in one change: its route (src/routes.tsx on a Xodia template site, the routes file on a React site with routes in code) and its file unless another route uses it, or its .html file on a plain HTML site. The home page stays. The answer lists the files removed and every file that still links to the page (links): fix or remove those links (nav, footer, Link to, a href), then run run_check kind "links". Nothing else is rewritten and no redirect is added: add one for a published page the site no longer needs (skill redirects). The site plan drops the page in the same change. Ask the user before deleting a page they wrote; dryRun says what would go first. Xodia saves every change at once, so there is no discard: to bring a page back, restore_checkpoint the last restore point from list_checkpoints taken before the delete, or the user restores it in Xodia (Project settings, Activity). Pages with a variable part are not deleted here: a collection's item page goes with its collection (CMS tools), any other one you remove in code. Refused with 409 and action ask_agent when Xodia can't change this site's routes safely (route_shape_unsupported, route_unreadable, delete_unsupported) or the HTML site lists its pages in vite.config (html_pages_listed): then remove it in code yourself. A page locked on the workspace's plan (list_pages, get_project lockedPages) is refused with plan_limit and reason page_locked. Where delete_page works, never delete a page by editing routes or files by hand. Saved at once, like every edit in Xodia; pushing to Git and publishing stay the user's. The site plan follows in the same change.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"projectId": "<projectId>"
},
"name": "delete_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The page's address ("/about"), as list_pages shows it | |
| branch | No | Optional branch; default the branch the workspace has open | |
| dryRun | No | Only say which files would go and which pages still link to it; deletes nothing | |
| projectId | Yes | Project id from list_projects |