MCP: pages, menus, redirects and site files
The MCP tools for routes (the website's own pages), menus, redirects and fixed-address site files such as robots.txt.
Routes are the website's own pages (About, Contact, Pricing). These tools make and change them, their menus, the redirects from old addresses, and the files served at fixed addresses.
This page lists 26 tools. How to read each entry, the website argument, permissions, publishing, errors and limits are on MCP reference.
Routes (pages)
list_routes
List the website's routes: its own pages (about, contact, pricing...), each with its path, title, URL slugs per language and SEO. With status "trash", the routes in the trash, which restore_route brings back.
- Permission: Routes · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
status |
string | No | "live" (default) or "trash". (one of live, trash) |
page |
integer | No | The page to read, from 1. Default 1. (min 1) |
per_page |
integer | No | How many items a page holds, at most 100. Default 25. (min 1; max 100) |
get_route
Read one route (a page of the site's own): its path, title, URL slugs per language, public URL, SEO, status (published or draft), publishAt, templateVariant, and "editingBy": the person who has it open in the panel's editor now (their changes would be refused until they leave), or null.
- Permission: Routes · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The route's id. (min 1) |
create_route
Create a page at a path of its own (for example "about" or "legal/privacy"). It is live at once unless isPublished is false (a draft, optionally scheduled with publishAt). Its template file, templates/route.{path}.json, is written to the theme's PUBLISHED files, not the draft, so the live page can render (unless the draft already holds that file); the answer's "templateWritten" names the path and the view ("published" or "draft") it is in. Later edits to that template go to the draft as usual.
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | The page's path in the default language, without a leading slash (for example "about"). Unique on the website. |
title |
object | Yes | The page's title. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
slugs |
object | No | The URL slug per language: {"l10n": true, "<locale>": "<slug>"}. Leave it out to derive them. |
isPublished |
boolean | No | Whether visitors see the page. A draft is a 404 to visitors and left out of the sitemap; preview it with create_page_preview_link. A new page is published unless this is false. |
publishAt |
string, or null | No | When a draft goes live, as an ISO 8601 date and time in the future; null for never. Only on a draft. |
templateVariant |
string, or null | No | The page's alternate template: renders templates/route.{path}.{variant}.json (list_template_variants "route.{path}"); one that does not exist yet starts as a copy of the page's own. null for the page's own template. |
update_route
Change a route's path, title, URL slugs, SEO, published state, schedule (publishAt) or alternate template (templateVariant). Only the arguments you give change. Changing the path renames its template file and its alternates and regenerates the slugs unless you give them; the rename happens in the theme's PUBLISHED files, not the draft, so the live page keeps rendering (a template only the draft holds is renamed in the draft), and the answer's "templateWritten" names the new path and the view it is in; "warnings" says when a draft template could not follow the page, and how to finish the move. Live at once. Refused while another person has it open in the panel's editor: the error names them and when their lock ends (get_entry or get_route "editingBy").
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The route's id. (min 1) |
path |
string | No | The page's path in the default language, without a leading slash (for example "about"). Unique on the website. |
title |
object | No | The page's title. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
slugs |
object | No | The URL slug per language: {"l10n": true, "<locale>": "<slug>"}. Leave it out to derive them. |
isPublished |
boolean | No | Whether visitors see the page. A draft is a 404 to visitors and left out of the sitemap; preview it with create_page_preview_link. A new page is published unless this is false. |
publishAt |
string, or null | No | When a draft goes live, as an ISO 8601 date and time in the future; null for never. Only on a draft. |
templateVariant |
string, or null | No | The page's alternate template: renders templates/route.{path}.{variant}.json (list_template_variants "route.{path}"); one that does not exist yet starts as a copy of the page's own. null for the page's own template. |
metaTitle |
object | No | The title search engines show. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
metaDescription |
object | No | The description search engines show. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
ogImage |
string, or null | No | The image shown when the page is shared: an http or https address (a media file's "url"), or null to remove it. |
noindex |
boolean | No | Hide the page from search engines: true asks them not to index it and leaves it out of the sitemaps; false shows it again. Visitors can still open it. Leave it out to keep it as it is. |
trash_route
Move a route to the trash. Its page goes offline at once, and menus that link to it stop showing it. restore_route brings it back with its template, slugs and SEO. Refused while another person has it open in the panel's editor: the error names them and when their lock ends (get_entry or get_route "editingBy").
- Permission: Routes · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The route's id. (min 1) |
restore_route
Bring a route back from the trash, with its template on the current theme. Find its id with list_routes and status "trash". Refused when a data list has taken its URL meanwhile.
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The trashed route's id. (min 1) |
duplicate_route
Copy a page: its content (its template file in the site theme), its SEO and a title with " (copy)", at a free path of its own ("<path>-copy"). The copy is a draft, not published: publish it with set_routes_published (or update_route) when it is ready. Answers the new route with its "id" and "path"; change its path and title with update_route.
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The id of the route to copy. (min 1) |
create_page_preview_link
Create a link that shows a page (a route) as it is saved, published or a draft, for a limited time (about a day). Use it to show the person a draft page before it goes live. "locale" is the language to show, one of the site's; the default language when omitted.
- Permission: Routes · View
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The route's id. (min 1) |
locale |
string | No | The language to show, as an iso code the site has (for example "en"). |
set_routes_published
Publish (published true) or unpublish (published false) several pages (routes) at once, live at once. Publishing clears a page's schedule (publishAt). Ids that are not live routes of this website, and pages already in that state, are skipped. At most 100 ids a call. Answers "affected", how many pages it changed, and "templateFailures", the ids of pages saved whose alternate template could not be written. Refused, changing nothing, while another person has any of them open in the panel's editor: the error names each one, its editor and when their lock ends.
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
ids |
array of integer | Yes | The ids of the routes to publish or unpublish, as list_routes answers them. (at most 100 items) |
published |
boolean | Yes | true to publish them, false to make them drafts (a 404 to visitors). |
set_routes_search_visibility
Hide several pages (routes) from search engines (hidden true: a noindex tag and out of the sitemap) or show them again (hidden false), at once. The pages stay published and open to visitors. Ids that are not live routes of this website, and pages already in that state, are skipped. At most 100 ids a call. Answers "affected", how many pages it changed, and "templateFailures", the ids of pages saved whose alternate template could not be written. Refused, changing nothing, while another person has any of them open in the panel's editor: the error names each one, its editor and when their lock ends.
- Permission: Routes · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
ids |
array of integer | Yes | The ids of the routes, as list_routes answers them. (at most 100 items) |
hidden |
boolean | Yes | true to hide them from search engines, false to show them again. |
trash_routes
Move several pages (routes) to the trash at once: they go offline at once. Ids that are not live routes of this website are skipped. At most 100 ids a call. Nothing is deleted for good: restore_route brings each back (list_routes with status "trash" lists them). Answers "affected", how many pages it moved. Refused, changing nothing, while another person has any of them open in the panel's editor: the error names each one, its editor and when their lock ends.
- Permission: Routes · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
ids |
array of integer | Yes | The ids of the routes to move to the trash, as list_routes answers them. (at most 100 items) |
delete_trashed_route
Delete a route that is in the trash for good, with its template, URL slugs and SEO. Find its id with list_routes and status "trash". A live route is refused: move it to the trash first with trash_route. This cannot be undone. Only do this when the person asked you to delete it for good.
- Permission: Routes · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The trashed route's id. (min 1) |
Menus
list_menus
List the website's menus (header, footer...), each with its links: a flat list in which "parentId" nests a link under another, and "object" says where it points. update_menu takes the same shape back. "themeMenuDepth" is how many levels the published theme draws a menu to (what visitors see), "draftThemeMenuDepth" the same for the theme's unpublished draft; null when the theme does not say.
- Permission: Navigation · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
page |
integer | No | The page to read, from 1. Default 1. (min 1) |
per_page |
integer | No | How many items a page holds, at most 100. Default 25. (min 1; max 100) |
update_menu
Rename a menu, or replace its links. With "links" the menu's whole set of links is replaced: read it with list_menus first and send every link you keep (with its id; use a new number for a new link). A link whose target page, list or entry is gone is left out and reported under "dropped". Links nested deeper than the theme draws menus ("themeMenuDepth" for the published theme, "draftThemeMenuDepth" for its draft) are saved but not shown, and "warnings" says so, naming the view when the two differ. A link to an unpublished page or entry is saved but hidden from visitors until its target is published (only an owner preview shows it), and "warnings" names it. A link whose "parentId" is not one of the links sent is saved at the top level, and "warnings" names it; each link needs its own id. Live at once.
- Permission: Navigation · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The menu's id. (min 1) |
title |
object | No | The menu's name. Left out with "links", it stays as it is. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
links |
array of object | No | The links in display order, top level first or not: nesting comes from "parentId", order within a level from the order here. Replaces every link of the menu. |
links[].id |
integer | Yes | The link's id from list_menus, or a new number (unique in this list) for a new link. |
links[].parentId |
integer, or null | No | The id of the link this one is nested under, or null for a top-level link. |
links[].title |
object | No | The link's text. Leave it out to use the target's own title. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
links[].object |
object | Yes | |
links[].object.type |
string | Yes | What the link points at: the home page, an external URL, a route, a data list or a data list entry. (one of frontpage_link, http_link, route_link, data_list_link, data_list_entry_link) |
links[].object.value |
string, or null | No | An http_link's address (https://..., a site path like /contact, #section, mailto: or tel:; required), or the id of the route, data list or entry. Not used for frontpage_link. |
create_menu
Create a new, empty menu (for example a footer menu), live at once. Answers the menu with its "id" and "handle", the name a theme section picks it by: a menu made here or in the panel gets its id as text (for example "12"), by design; only a theme's own menus carry word handles such as "main-menu". Add its links with update_menu.
- Permission: Navigation · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
title |
object | Yes | The menu's name, at most 50 characters per language. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed. |
delete_menu
Delete a menu and all its links. Menus have no trash: the menu is gone at once, and a theme section that showed it shows no menu. Only do this when the person asked you to. To change a menu's links, use update_menu instead.
- Permission: Navigation · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The menu's id, from list_menus. (min 1) |
Redirects
list_redirects
List the website's manual redirects (old path to new destination), a page at a time in path order. With "search", only those whose old path or destination contains it.
- Permission: Redirects · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
search |
string | No | Only redirects whose old path or destination contains this text. |
page |
integer | No | The page to read, from 1. Default 1. (min 1) |
per_page |
integer | No | How many items a page holds, at most 100. Default 25. (min 1; max 100) |
create_redirect
Create a redirect from an old path to a new destination (a path on this site or an absolute URL). Live at once. When a page already answers the old path the answer carries a "warning": the redirect cannot fire until that page is moved.
- Permission: Redirects · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
source_path |
string | Yes | The old path, as visitors type it (for example "/old-pricing"). A leading language code ("/ar/old-pricing") limits the redirect to that language. |
target |
string | Yes | Where visitors are sent: a path on this site ("/plans") or an absolute http(s) URL. |
locale |
string | No | A language code to limit the redirect to, or an empty string (default) for every language. |
status_code |
integer | No | 301 or 308 for a permanent move, 302 (default) or 307 for a temporary one. (one of 302, 301, 307, 308) |
update_redirect
Change a redirect's old path, destination, language or status code. Only the arguments you give change. Live at once.
- Permission: Redirects · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The redirect's id. (min 1) |
source_path |
string | No | The old path, as visitors type it (for example "/old-pricing"). A leading language code ("/ar/old-pricing") limits the redirect to that language. |
target |
string | No | Where visitors are sent: a path on this site ("/plans") or an absolute http(s) URL. |
locale |
string | No | A language code to limit the redirect to, or an empty string (default) for every language. |
status_code |
integer | No | 301 or 308 for a permanent move, 302 (default) or 307 for a temporary one. (one of 302, 301, 307, 308) |
delete_redirect
Delete a redirect. Redirects have no trash: the old path stops redirecting at once. The deletion is recorded in the website's history, but it cannot be restored from there: make the redirect again.
- Permission: Redirects · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The redirect's id. (min 1) |
Site files
list_site_files
List the website's site files (files at fixed addresses such as /robots.txt, /ads.txt or /.well-known/*), a page at a time in path order, without their content. A file the active theme provides has source "theme" and no id; it answers until you write your own file at its path. With status "trash", the files in the trash, which restore_site_file brings back.
- Permission: Site files · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
status |
string | No | "live" (default) or "trash". (one of live, trash) |
page |
integer | No | The page to read, from 1. Default 1. (min 1) |
per_page |
integer | No | How many items a page holds, at most 100. Default 25. (min 1; max 100) |
get_site_file
Read one site file with its content, version and source, by its id (from list_site_files) or by its path. A path finds your own file first, else the file the active theme provides there (source "theme", no id). Send the version back as base_version when you change the file, or write over a theme file, with put_site_file. An image's content is base64 (encoding "base64").
- Permission: Site files · View
- Read-only
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | No | The site file's id, as list_site_files answers it. Give the id or the path. (min 1) |
path |
string | No | The file's path, for example "robots.txt" (a leading "/" is ignored): your own file at that path or serving that address ("robots.txt" finds your "robots.txt.liquid"), else the file the active theme provides there; the answer's "source" says which. Give the id or the path. |
put_site_file
Create a site file at a path (for example "robots.txt", "ads.txt" or ".well-known/security.txt"), or replace the one stored there. Live at once. To replace an existing file, or to write over a file the active theme provides at that path, read it first with get_site_file and send its version as base_version; a file changed since is refused (read it again and retry). Answers the file with its content and any warnings.
- Permission: Site files · Edit
- Idempotent
| Argument | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | The file's address without the leading slash, for example "robots.txt". |
content |
string | Yes | The whole file. With encoding "base64" it is the base64 of the bytes (an image); otherwise it is the text. May be empty. |
encoding |
string | No | "utf8" (default) or "base64". (one of utf8, base64) |
base_version |
string | No | The version get_site_file answered for the file you are replacing. Required to replace a file that exists or a theme file at that path; leave it out to create a new one. |
trash_site_file
Move one of your own site files to the trash, by its id from list_site_files. Its address stops answering at once, or answers the file the active theme provides there. restore_site_file brings it back. A theme file (source "theme", no id) cannot be trashed.
- Permission: Site files · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The site file's id, as list_site_files answers it. (min 1) |
restore_site_file
Bring a site file back from the trash. Find its id with list_site_files and status "trash". Refused when another file now answers its address, a redirect now lands there, or the site is at its file limits.
- Permission: Site files · Edit
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The trashed site file's id. (min 1) |
delete_trashed_site_file
Delete a site file that is in the trash for good: it can no longer be restored, and its saved versions can no longer be opened. Find its id with list_site_files and status "trash". A live file is refused: move it to the trash first with trash_site_file. This cannot be undone. Only do this when the person asked you to delete it for good.
- Permission: Site files · Edit
- Destructive
| Argument | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The trashed site file's id. (min 1) |