@typeroll/mcp-server 0.45.124 → 0.45.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ const MENU_MODEL = 'A menu has an id, a name, optional `locations` and a tree of
11
11
  'Item types: `page` (page_id; links by page id, so the label and address follow renames and moves, and an unpublished or deleted page drops out with a warning; `label` overrides the title), ' +
12
12
  '`url` (href and label; an external address, a path or an #anchor), `children` (page_id; lists that page\'s published child pages automatically: with a label they form a submenu under it, without one they sit in place) ' +
13
13
  'and `heading` (label only, no link; a column title in a wide submenu). Any item may set `description` (a short line in submenus), `icon` and `link_rel`. Items with `children` get a submenu. ' +
14
- 'Locations: `primary` (header), `footer` and `mobile`, or another short lowercase name; one menu per location per site. ' +
14
+ 'Locations: `primary` (header), `footer` and `mobile`, or another short lowercase name; one menu per location per site. A site can have any number of menus: a menu without locations is shown by its id (menu: "<id>"). To put your own menu in a location another menu fills (a new site\'s `primary` and `footer` menus fill those two), save it with take_locations: true: the location moves to your menu and the other menu keeps its items, so nothing has to be deleted first. ' +
15
15
  '`auto_add_pages: true` appends new top-level published pages (other than the home page) to the end automatically. ' +
16
16
  'To show a menu, use a `core/navigation_links` block with data { source: "menu", menu: "location:primary" } (or a menu id) and optionally `submenus`: auto (dropdown in a row, accordion in a column and the mobile drawer), dropdown, accordion, expanded or none. It needs render version 15 (read_site_settings → render.version; raise it with tr-upgrade-rendering).';
17
17
  // Nested items have the same shape; they stay untyped here so the schema is
@@ -53,7 +53,7 @@ function menuFailure(error) {
53
53
  text: JSON.stringify({
54
54
  error: error.message,
55
55
  status: 409,
56
- hint: 'Either someone saved the menu after you read it (read_menu again and reapply your change with the new updated_at), or a location you set is already filled by another menu (remove it there first).',
56
+ hint: 'Either someone saved the menu after you read it (read_menu again and reapply your change with the new updated_at), or a location you set is already filled by another menu: send take_locations: true to move the location to this menu (the other menu keeps its items).',
57
57
  }, null, 2),
58
58
  }],
59
59
  isError: true,
@@ -95,12 +95,13 @@ const menuBody = (menu) => ({
95
95
  ...(menu.locations !== undefined ? { locations: menu.locations } : {}),
96
96
  ...(menu.auto_add_pages !== undefined ? { auto_add_pages: menu.auto_add_pages } : {}),
97
97
  items: menu.items,
98
+ ...(menu.take_locations ? { take_locations: true } : {}),
98
99
  });
99
100
  export const menuTools = [
100
101
  {
101
102
  name: 'list_menus',
102
103
  description: 'List the site\'s menus (WordPress-style menus with locations): each with its id, name, locations, auto_add_pages, items and updated_at. ' +
103
- 'Check this before building a header or footer: a new site starts with a `primary` menu (location primary, Home, auto_add_pages on) and a `footer` menu. ' + MENU_MODEL,
104
+ 'Check this before building a header or footer: a new site starts with a `primary` menu (location primary, Home, auto_add_pages on) and a `footer` menu. Edit those, or create your own menus beside them with update_menu (take_locations: true gives yours their location). ' + MENU_MODEL,
104
105
  inputSchema: { version: versionParam },
105
106
  handler: async (args, { client, siteId }) => {
106
107
  try {
@@ -127,6 +128,7 @@ export const menuTools = [
127
128
  {
128
129
  name: 'update_menu',
129
130
  description: 'Create a menu or replace a whole menu (name, locations, auto_add_pages and the full item tree). ' +
131
+ 'Your own menu in the header of a new site, without deleting its starter menu: { name: "Huvudmeny", locations: ["primary"], take_locations: true, items: [...] } creates it and moves the primary location to it. ' +
130
132
  'To change an existing menu: read_menu, edit the tree, and send it back with expected_updated_at set to the updated_at you read; a save by someone else in between returns 409. Without menu_id, or with a menu_id that does not exist yet, the menu is created. ' +
131
133
  'Every save is validated as a whole and keeps the previous menu as a revision; an invalid menu returns `errors` with the path of each problem (for example items[0].href). ' +
132
134
  'Link pages with type "page" and their page_id (from list_pages), not with url items, so renames follow; use a "children" item for an automatic submenu of a page\'s child pages. ' +
@@ -135,6 +137,7 @@ export const menuTools = [
135
137
  menu_id: z.string().optional().describe('The menu to replace or create. Omit to create a menu whose id is derived from the name.'),
136
138
  name: z.string().describe('Shown in the portal, e.g. "Main menu".'),
137
139
  locations: z.array(z.string()).optional().describe('primary, footer, mobile or another short lowercase name. Omit to keep none; [] clears them.'),
140
+ take_locations: z.boolean().optional().describe('Move a listed location that another menu fills to this menu instead of failing with 409. The other menu keeps its items and other locations (its change is kept as a revision); the result lists moved_locations: [{ location, from_menu_id }].'),
138
141
  auto_add_pages: z.boolean().optional().describe('Append new top-level published pages automatically.'),
139
142
  items: z.array(itemShape).describe('The whole item tree, at most 3 levels deep and 200 items.'),
140
143
  expected_updated_at: z.string().optional().describe('The updated_at from read_menu or list_menus. Required to replace an existing menu.'),
@@ -13,7 +13,7 @@ export const pageTemplateTools = [
13
13
  handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, 'page-templates', { version: args.version }))) },
14
14
  { name: 'read_page_template', description: 'Read one reusable Page template and its block tree.', inputSchema: { template_id: z.string(), version: versionParam },
15
15
  handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, `page-templates/${encodeURIComponent(args.template_id)}`, { version: args.version }))) },
16
- { name: 'create_page_template', description: 'Create a reusable template. Choose a starter or provide blocks, including template_content_slot for the Page body. Assign its ID to a content type’s template or a Page’s template.', inputSchema: { name: z.string(), ...fields, starter: z.enum(['blog', 'article', 'checklist', 'team', 'events', 'products', 'profile', 'landing', 'custom']).optional(), version: versionParam },
16
+ { name: 'create_page_template', description: 'Create a reusable template. Give a display name such as "Artikel": the ID is derived from it (lowercase ASCII, å/ä/ö → a/a/o, spaces → hyphens, -2 suffix when taken) and the name becomes the label. Pass id only to choose the ID yourself (1-64 lowercase letters, digits, _ or -). Choose a starter or provide blocks, including template_content_slot for the Page body. Assign the returned template.id to a content type’s template or a Page’s template.', inputSchema: { name: z.string().optional().describe('Display name; also the source of the ID when id is omitted'), id: z.string().optional().describe('Exact template ID; a taken ID returns 409'), ...fields, starter: z.enum(['blog', 'article', 'checklist', 'team', 'events', 'products', 'profile', 'landing', 'custom']).optional(), version: versionParam },
17
17
  handler: withErrorBoundary(async (args, { client, siteId }) => { const { version, ...body } = args; return ok(await client.post(siteId, 'page-templates', body, { version })); }) },
18
18
  { name: 'update_page_template', description: 'Update a reusable Page template. The change is saved immediately and affects its Pages on the next publication. A version isolates the edit from main.', inputSchema: { template_id: z.string(), patch: z.object(fields), version: versionParam },
19
19
  handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.patch(siteId, `page-templates/${encodeURIComponent(args.template_id)}`, args.patch, { version: args.version }))) },
@@ -132,6 +132,7 @@ export const pageTools = [
132
132
  blocks: z.array(z.any()).optional().describe('Block tree — only used when content_mode="blocks". Omit to get the default heading+prose seed.'),
133
133
  status: z.enum(['draft', 'review', 'unlisted', 'published']).optional(),
134
134
  breadcrumb_label: z.string().max(200).nullable().optional().describe('Optional short breadcrumb label. Leaves Page title, SEO title and route unchanged; null/empty uses the title.'),
135
+ excerpt: z.string().max(1000).nullable().optional().describe('Plain-text summary (up to 1000 characters) shown by template/page_excerpt ({{page.excerpt}}) and Page cards in listings. Every content type has it; when the type defines its own excerpt field the value is stored there. Saved like other content (draft until saved); null clears it.'),
135
136
  seo_title: z.string().optional(),
136
137
  append_seo_suffix: z.boolean().optional().describe('Set false to omit the site default SEO suffix on this page.'),
137
138
  seo_description: z.string().optional(),
@@ -163,7 +164,7 @@ export const pageTools = [
163
164
  },
164
165
  {
165
166
  name: 'update_page',
166
- description: 'Shallow-merge update on a page, including its short breadcrumb label (only the fields you pass change). BUFFER MODEL: content fields land in the page\'s unsaved DRAFT (working copy) — invisible to deploys and default previews until saved; `status`/`date_published` apply immediately. Pass save:true to commit in the same call, or commit_working_copy later after the user approves. Returns the draft view of the page. For "replace this page entirely", use replace_page. This tool does not accept content_mode; switch modes with `set_page_mode`.',
167
+ description: 'Shallow-merge update on a page, including its short breadcrumb label and excerpt (only the fields you pass change). BUFFER MODEL: content fields land in the page\'s unsaved DRAFT (working copy) — invisible to deploys and default previews until saved; `status`/`date_published` apply immediately. Pass save:true to commit in the same call, or commit_working_copy later after the user approves. Returns the draft view of the page. For "replace this page entirely", use replace_page. This tool does not accept content_mode; switch modes with `set_page_mode`.',
167
168
  inputSchema: {
168
169
  page_id: z.string(),
169
170
  patch: z
@@ -180,6 +181,7 @@ export const pageTools = [
180
181
  author: z.string().optional(),
181
182
  language: z.string().optional(),
182
183
  breadcrumb_label: z.string().max(200).nullable().optional().describe('Optional short breadcrumb label. Leaves Page title, SEO title and route unchanged; null/empty uses the title.'),
184
+ excerpt: z.string().max(1000).nullable().optional().describe('Plain-text summary (up to 1000 characters) shown by template/page_excerpt and Page cards. Lands in the draft like other content; null clears it.'),
183
185
  seo_title: z.string().optional(),
184
186
  append_seo_suffix: z.boolean().optional().describe('Set false to use seo_title/page title verbatim without the site suffix.'),
185
187
  seo_description: z.string().optional(),
@@ -11,7 +11,7 @@ const SNIPPET_MODEL = 'A live snippet is content outside the build: saving it up
11
11
  'kind "dated": entries keyed by date or weekday, and the page shows today\'s entry in the site\'s time zone (read_site_settings → time_zone), chosen in the visitor\'s browser: ' +
12
12
  '{ kind: "dated", format: "html" | "text", entries: [{ weekday: "monday", content: "…" }, …, { date: "2026-12-24", content: "Closed" }], fallback: "No lunch today" }. ' +
13
13
  'A date entry wins over a weekday entry; fallback shows on a day without one. For "today\'s lunch", write the whole week once (one entry per weekday, plus dated exceptions) instead of saving every day; the file stays unchanged between writes. ' +
14
- 'To show a snippet on a page, place a `core/snippet` block with data { snippet: "<snippet id>" } where it should appear: the page carries the value of the latest publication (for search engines and without script) and the browser then shows the newest. ' +
14
+ 'To show a snippet on a page, place a `core/snippet` block with data { snippet: "<snippet id>" } where it should appear: the page carries the value of the latest publication (for search engines and without script) and the browser then shows the newest. Previews (get_preview_link, get_page_preview, the editor) render the snippet as saved when they are opened and fetch no live file; reload a preview to see a later save. ' +
15
15
  'Placing or moving the block is a page edit that needs a publication; changing the snippet afterwards does not. ' +
16
16
  'A site field defined with `live: true` (define_site_fields) works the same way for a single value: the `core/site_field` block shows its newest value without publishing. ' +
17
17
  'Every save answers `live`: { published: true, url } when the public file was written, or { published: false, reason } when the site has no media host that can serve it (the snippet is still saved and shows at the next publication).';
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@
8
8
  //
9
9
  // Keep it in lockstep with package.json: tests/version.test.ts asserts
10
10
  // VERSION === package.json.version, so a bump that forgets this line fails CI.
11
- export const VERSION = '0.45.124';
11
+ export const VERSION = '0.45.125';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@typeroll/mcp-server",
3
3
  "mcpName": "io.github.Typeroll/typeroll",
4
- "version": "0.45.124",
4
+ "version": "0.45.125",
5
5
  "description": "Typeroll CMS MCP server \u2013 connect AI agents to the REST API to manage content and publish static websites.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,7 +33,11 @@ one-off link list, use inline `links` instead.
33
33
  ## Menus first
34
34
 
35
35
  1. `list_menus`. Make sure one menu fills `primary` and one fills `footer`;
36
- create missing ones with `update_menu` (`locations: ["primary"]`).
36
+ create missing ones with `update_menu` (`locations: ["primary"]`). Either
37
+ edit the starter menus or create your own beside them: `update_menu
38
+ name="Huvudmeny" locations=["primary"] take_locations=true items=[...]`
39
+ moves the location to your menu and leaves the starter menu's items intact
40
+ (no delete needed; the result lists `moved_locations`).
37
41
  2. Build the link tree with `update_menu` (read it first and pass
38
42
  `expected_updated_at`) or `add_menu_item`: `type: "page"` with the
39
43
  `page_id` from `list_pages` for every Page, `type: "children"` with a
@@ -236,7 +236,9 @@ footer's at `location:footer` (render version 15; raise it first with
236
236
  `tr-upgrade-rendering` if `read_site_settings` → `render.version` is lower).
237
237
  After creating the Pages, curate the menus with `add_menu_item` or
238
238
  `update_menu`: Page items by `page_id`, a `children` item for an automatic
239
- submenu, `url` items only for external addresses. Do not type Page URLs into
239
+ submenu, `url` items only for external addresses. To use your own menu instead,
240
+ create it with `locations: ["primary"]` and `take_locations: true`; the starter
241
+ menu keeps its items without the location. Do not type Page URLs into
240
242
  inline `links`; they do not follow renames.
241
243
 
242
244
  Stage the complete tree with `update_partial partial_id="header"
@@ -18,6 +18,9 @@ default template, and an individual Page can override it.
18
18
  1. `create_page_template name="article-layout" label="Article" starter="article" status="published"`.
19
19
  Alternatively supply `blocks` instead of `starter`. Presets include article,
20
20
  blog, checklist, team, events, products, profile, landing and custom.
21
+ A display name in the site's language works too (`name="Artikel"`): the ID is
22
+ derived from it (`artikel`, with `-2` when taken) and the name becomes the
23
+ label. Use the returned `template.id` in the next step.
21
24
  2. `update_content_type name="articles" patch={template:"article-layout"}`.
22
25
  For a single-page override, `update_page page_id=... patch={template:"article-layout"} save=true`.
23
26
  3. Read and edit the template through `read_page_template` or block tools with
@@ -29,6 +32,9 @@ default template, and an individual Page can override it.
29
32
  `template/page_featured_image`, `template/page_breadcrumbs` and
30
33
  `template/page_navigation`. The outline block reads the rendered body headings.
31
34
  6. Use `{{page.title}}` or `{{page.custom_field}}` in template bindings.
35
+ `template/page_excerpt` shows the Page's `excerpt`: set it per Page with
36
+ `update_page page_id=... patch={excerpt:"…"} save=true` (any content type;
37
+ a type with its own `excerpt` field stores it there).
32
38
  A repeater's children use `{{item.title}}` for the current listed Page.
33
39
  Custom fields can be typed objects, arrays or Page references; preserve those
34
40
  structures instead of storing hand-generated list HTML.
@@ -142,9 +142,18 @@ Images preserve the complete subject with intrinsic height and contain; request
142
142
  cover and a ratio explicitly only when cropping is intended. Breadcrumb spacing
143
143
  uses --breadcrumbs-before / --breadcrumbs-after. Custom field-list item_html
144
144
  replaces native bullets; core/list marker none supports custom icons.
145
- Preview and static CSS order is defaults → blocks/instances → site → Page;
146
- specificity, inline CSS and !important still apply. Compare without temporary
147
- corrective CSS before removing any existing site rules.
145
+ Preview and static CSS order is defaults → blocks/instances → site → Page.
146
+ From render version 14 all platform CSS sits in cascade layers (reset, base,
147
+ tokens, platform, instance) and site and Page CSS are unlayered, so a plain
148
+ site rule beats any platform rule whatever its specificity; do not add
149
+ !important or doubled selectors to win. Before 14, specificity and order
150
+ decide. Inline values still beat stylesheets: from render version 16 the
151
+ platform writes only custom properties inline (spacing, text colour, image
152
+ width and responsive values move to the instance layer), settings are exposed
153
+ as data attributes (`[data-block="grid"][data-gap="sm"]`, not
154
+ `[style*="--gap:sm"]`), and platform media queries follow the site's
155
+ responsive widths. hidden_on visibility keeps its !important on purpose.
156
+ Compare without temporary corrective CSS before removing any existing site rules.
148
157
 
149
158
 
150
159
  ## Site-specific responsive widths (Core 0.2.28)