@charisol/plexo-mcp 1.0.7 → 1.0.9
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.
- package/dist/blogTools.js +690 -0
- package/dist/client/plexoClient.js +180 -3
- package/dist/index.js +143 -5
- package/package.json +1 -1
- package/src/blogTools.ts +695 -0
- package/src/client/plexoClient.ts +218 -3
- package/src/index.ts +146 -5
|
@@ -196,19 +196,29 @@ export class PlexoClient {
|
|
|
196
196
|
/**
|
|
197
197
|
* Creates a new page nested under an existing landing page (its home page
|
|
198
198
|
* for a top-level page, or another sub-page's id to nest deeper) — how a
|
|
199
|
-
* single landing page becomes a multi-page site. Starts blank
|
|
200
|
-
*
|
|
199
|
+
* single landing page becomes a multi-page site. Starts blank unless
|
|
200
|
+
* htmlContent is given, in which case it's created as a RAW_UPLOAD page
|
|
201
|
+
* instead — see updateTemplate() (BUILDER) / updateRawLandingPage()
|
|
202
|
+
* (RAW_UPLOAD) to add/edit content afterward, depending on which mode.
|
|
201
203
|
*/
|
|
202
204
|
async createLandingPageSubpage(params: {
|
|
203
205
|
parentTemplateId: string;
|
|
204
206
|
name: string;
|
|
205
207
|
slug?: string;
|
|
208
|
+
htmlContent?: string;
|
|
209
|
+
acceptAup?: boolean;
|
|
206
210
|
}): Promise<any> {
|
|
207
211
|
this.checkAuth();
|
|
208
212
|
const res = await fetch(`${this.baseUrl}/api/templates`, {
|
|
209
213
|
method: "POST",
|
|
210
214
|
headers: this.getHeaders(),
|
|
211
|
-
body: JSON.stringify({
|
|
215
|
+
body: JSON.stringify({
|
|
216
|
+
name: params.name,
|
|
217
|
+
parentId: params.parentTemplateId,
|
|
218
|
+
slug: params.slug,
|
|
219
|
+
htmlContent: params.htmlContent,
|
|
220
|
+
acceptAup: params.acceptAup,
|
|
221
|
+
}),
|
|
212
222
|
});
|
|
213
223
|
|
|
214
224
|
const data = (await res.json()) as any;
|
|
@@ -219,6 +229,81 @@ export class PlexoClient {
|
|
|
219
229
|
return data;
|
|
220
230
|
}
|
|
221
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Creates a landing page from raw HTML supplied directly (no designJson),
|
|
234
|
+
* served byte-for-byte as given — a different storage mode from
|
|
235
|
+
* createLandingPage/publishLandingPage, which are for the drag-and-drop
|
|
236
|
+
* BUILDER pages built from designJson. Same endpoint upload-raw's REST
|
|
237
|
+
* multipart path uses, but with a JSON body — this client has no real
|
|
238
|
+
* file to upload.
|
|
239
|
+
*/
|
|
240
|
+
async createRawLandingPage(params: { name?: string; htmlContent: string; acceptAup?: boolean }): Promise<any> {
|
|
241
|
+
this.checkAuth();
|
|
242
|
+
const res = await fetch(`${this.baseUrl}/api/v1/templates/upload-raw`, {
|
|
243
|
+
method: "POST",
|
|
244
|
+
headers: this.getHeaders(),
|
|
245
|
+
body: JSON.stringify(params),
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
const data = (await res.json()) as any;
|
|
249
|
+
if (!res.ok) {
|
|
250
|
+
throw new Error(data?.error || `Raw landing page creation failed with status ${res.status}`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return data;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Creates AND publishes a raw-HTML landing page in one call — the combined
|
|
258
|
+
* equivalent of createRawLandingPage() + publishExistingLandingPage().
|
|
259
|
+
*/
|
|
260
|
+
async publishRawLandingPage(params: {
|
|
261
|
+
name?: string;
|
|
262
|
+
htmlContent: string;
|
|
263
|
+
acceptAup?: boolean;
|
|
264
|
+
domain: string;
|
|
265
|
+
type?: "SUBDOMAIN" | "CUSTOM";
|
|
266
|
+
}): Promise<any> {
|
|
267
|
+
const created = await this.createRawLandingPage({
|
|
268
|
+
name: params.name,
|
|
269
|
+
htmlContent: params.htmlContent,
|
|
270
|
+
acceptAup: params.acceptAup,
|
|
271
|
+
});
|
|
272
|
+
const templateId = created?.templateId;
|
|
273
|
+
if (!templateId) {
|
|
274
|
+
throw new Error(created?.error || "Raw landing page creation did not return a templateId.");
|
|
275
|
+
}
|
|
276
|
+
const published = await this.publishExistingLandingPage({
|
|
277
|
+
templateId,
|
|
278
|
+
domain: params.domain,
|
|
279
|
+
type: params.type,
|
|
280
|
+
});
|
|
281
|
+
return { ...created, ...published };
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Replaces an existing RAW_UPLOAD page's HTML in place, under the same
|
|
286
|
+
* template id — the editable URL, live URL, and domain (if published) are
|
|
287
|
+
* all unchanged. Same endpoint replace-upload's REST multipart path uses,
|
|
288
|
+
* but with a JSON body.
|
|
289
|
+
*/
|
|
290
|
+
async updateRawLandingPage(params: { templateId: string; htmlContent: string; name?: string }): Promise<any> {
|
|
291
|
+
this.checkAuth();
|
|
292
|
+
const { templateId, ...body } = params;
|
|
293
|
+
const res = await fetch(`${this.baseUrl}/api/v1/templates/${encodeURIComponent(templateId)}/replace-upload`, {
|
|
294
|
+
method: "POST",
|
|
295
|
+
headers: this.getHeaders(),
|
|
296
|
+
body: JSON.stringify(body),
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
const data = (await res.json()) as any;
|
|
300
|
+
if (!res.ok) {
|
|
301
|
+
throw new Error(data?.error || `Raw landing page update failed with status ${res.status}`);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return data;
|
|
305
|
+
}
|
|
306
|
+
|
|
222
307
|
/**
|
|
223
308
|
* Returns every page belonging to the same multi-page site as templateId
|
|
224
309
|
* — its home page plus all nested sub-pages. templateId can be the home
|
|
@@ -355,4 +440,134 @@ export class PlexoClient {
|
|
|
355
440
|
|
|
356
441
|
return data;
|
|
357
442
|
}
|
|
443
|
+
|
|
444
|
+
/** Fetches a single template's full details, including designJson — used by the blog
|
|
445
|
+
* layout tools to read back a layout template's current content (there's no other
|
|
446
|
+
* templateId-scoped GET in the public API; list endpoints only return metadata). */
|
|
447
|
+
async getTemplate(templateId: string): Promise<any> {
|
|
448
|
+
this.checkAuth();
|
|
449
|
+
const res = await fetch(`${this.baseUrl}/api/v1/templates/${encodeURIComponent(templateId)}`, {
|
|
450
|
+
method: "GET",
|
|
451
|
+
headers: this.getHeaders(),
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const data = (await res.json()) as any;
|
|
455
|
+
if (!res.ok) {
|
|
456
|
+
throw new Error(data?.error || `Failed to fetch template (Status ${res.status})`);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return data;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** Shared request helper for every /api/blog/{templateId}/... route below — these are
|
|
463
|
+
* the same admin endpoints the Plexo dashboard's own blog UI calls, and (like every
|
|
464
|
+
* other route in this client) accept the same Bearer/x-api-key auth as the rest of the
|
|
465
|
+
* public API (see resolveUser/resolveBlogAdminSite server-side). */
|
|
466
|
+
private async blogFetch(method: string, templateId: string, path: string, body?: unknown): Promise<any> {
|
|
467
|
+
this.checkAuth();
|
|
468
|
+
const res = await fetch(`${this.baseUrl}/api/blog/${encodeURIComponent(templateId)}${path}`, {
|
|
469
|
+
method,
|
|
470
|
+
headers: this.getHeaders(),
|
|
471
|
+
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
const data = (await res.json().catch(() => ({}))) as any;
|
|
475
|
+
if (!res.ok) {
|
|
476
|
+
throw new Error(data?.error || `Blog request failed (Status ${res.status})`);
|
|
477
|
+
}
|
|
478
|
+
return data;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** Idempotent — returns the existing layout template id if one's already attached to
|
|
482
|
+
* this kind rather than creating a duplicate. Pair with updateTemplate() to set its
|
|
483
|
+
* designJson (see blogTools.ts's designBlogLayout). */
|
|
484
|
+
async ensureBlogLayout(templateId: string, kind: "post" | "listing"): Promise<any> {
|
|
485
|
+
return this.blogFetch("POST", templateId, `/layout/${kind}`);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/** Detaches the layout (reverts to the default theme) without deleting the underlying Template row. */
|
|
489
|
+
async resetBlogLayout(templateId: string, kind: "post" | "listing"): Promise<any> {
|
|
490
|
+
return this.blogFetch("DELETE", templateId, `/layout/${kind}`);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
async getBlogSite(templateId: string): Promise<any> {
|
|
494
|
+
return this.blogFetch("GET", templateId, "/site");
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
async updateBlogSite(templateId: string, patch: Record<string, any>): Promise<any> {
|
|
498
|
+
return this.blogFetch("PATCH", templateId, "/site", patch);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
async listBlogPosts(templateId: string, params: { status?: string; search?: string; categoryId?: string } = {}): Promise<any> {
|
|
502
|
+
const query = new URLSearchParams();
|
|
503
|
+
if (params.status) query.set("status", params.status);
|
|
504
|
+
if (params.search) query.set("search", params.search);
|
|
505
|
+
if (params.categoryId) query.set("categoryId", params.categoryId);
|
|
506
|
+
const qs = query.toString();
|
|
507
|
+
return this.blogFetch("GET", templateId, `/posts${qs ? `?${qs}` : ""}`);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
async getBlogPost(templateId: string, postId: string): Promise<any> {
|
|
511
|
+
return this.blogFetch("GET", templateId, `/posts/${encodeURIComponent(postId)}`);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
async createBlogPost(templateId: string, payload: Record<string, any>): Promise<any> {
|
|
515
|
+
return this.blogFetch("POST", templateId, "/posts", payload);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
async updateBlogPost(templateId: string, postId: string, payload: Record<string, any>): Promise<any> {
|
|
519
|
+
return this.blogFetch("PATCH", templateId, `/posts/${encodeURIComponent(postId)}`, payload);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
async deleteBlogPost(templateId: string, postId: string): Promise<any> {
|
|
523
|
+
return this.blogFetch("DELETE", templateId, `/posts/${encodeURIComponent(postId)}`);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
async listBlogCategories(templateId: string): Promise<any> {
|
|
527
|
+
return this.blogFetch("GET", templateId, "/categories");
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
async createBlogCategory(templateId: string, payload: { name: string; description?: string; parentId?: string | null }): Promise<any> {
|
|
531
|
+
return this.blogFetch("POST", templateId, "/categories", payload);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
async deleteBlogCategory(templateId: string, categoryId: string): Promise<any> {
|
|
535
|
+
return this.blogFetch("DELETE", templateId, `/categories/${encodeURIComponent(categoryId)}`);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
async listBlogTags(templateId: string): Promise<any> {
|
|
539
|
+
return this.blogFetch("GET", templateId, "/tags");
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
async createBlogTag(templateId: string, name: string): Promise<any> {
|
|
543
|
+
return this.blogFetch("POST", templateId, "/tags", { name });
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
async deleteBlogTag(templateId: string, tagId: string): Promise<any> {
|
|
547
|
+
return this.blogFetch("DELETE", templateId, `/tags/${encodeURIComponent(tagId)}`);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
async listBlogAuthors(templateId: string): Promise<any> {
|
|
551
|
+
return this.blogFetch("GET", templateId, "/authors");
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
async createBlogAuthor(templateId: string, payload: { name: string; bio?: string; avatarUrl?: string }): Promise<any> {
|
|
555
|
+
return this.blogFetch("POST", templateId, "/authors", payload);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
async deleteBlogAuthor(templateId: string, authorId: string): Promise<any> {
|
|
559
|
+
return this.blogFetch("DELETE", templateId, `/authors/${encodeURIComponent(authorId)}`);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
async listBlogComments(templateId: string, status?: string): Promise<any> {
|
|
563
|
+
return this.blogFetch("GET", templateId, `/comments${status ? `?status=${encodeURIComponent(status)}` : ""}`);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
async moderateBlogComment(templateId: string, commentId: string, status: string): Promise<any> {
|
|
567
|
+
return this.blogFetch("PATCH", templateId, `/comments/${encodeURIComponent(commentId)}`, { status });
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
async deleteBlogComment(templateId: string, commentId: string): Promise<any> {
|
|
571
|
+
return this.blogFetch("DELETE", templateId, `/comments/${encodeURIComponent(commentId)}`);
|
|
572
|
+
}
|
|
358
573
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ListToolsRequestSchema,
|
|
8
8
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
9
9
|
import { PlexoClient } from "./client/plexoClient.js";
|
|
10
|
+
import { BLOG_TOOL_DEFS, BLOG_TOOL_NAMES, handleBlogToolCall } from "./blogTools.js";
|
|
10
11
|
|
|
11
12
|
const server = new Server(
|
|
12
13
|
{
|
|
@@ -136,7 +137,7 @@ EXAMPLE VALID designJson PAYLOAD (hero row, plus a 3-item product grid row):
|
|
|
136
137
|
properties: {
|
|
137
138
|
type: {
|
|
138
139
|
type: "string",
|
|
139
|
-
enum: ["heading", "paragraph", "text", "button", "card", "image", "menu", "social", "divider", "spacer", "form_container", "input", "textarea", "select", "carousel", "html", "icon", "table", "timer", "video"],
|
|
140
|
+
enum: ["heading", "paragraph", "text", "button", "card", "image", "menu", "social", "divider", "spacer", "form_container", "input", "textarea", "select", "carousel", "html", "icon", "table", "timer", "video", "accordion", "blog_title", "blog_content", "blog_featured_image", "blog_date", "blog_author", "blog_categories", "blog_comments", "blog_post_list"],
|
|
140
141
|
},
|
|
141
142
|
style: { type: "object" },
|
|
142
143
|
attributes: { type: "object", description: "Component attributes (text, href, src, title, description, links, fields). For type 'html', raw markup goes under 'htmlContent' — NOT 'text'." },
|
|
@@ -228,7 +229,7 @@ Uses the SAME fully-hydrated layout schema as publish_landing_page — designJso
|
|
|
228
229
|
properties: {
|
|
229
230
|
type: {
|
|
230
231
|
type: "string",
|
|
231
|
-
enum: ["heading", "paragraph", "text", "button", "card", "image", "menu", "social", "divider", "spacer", "form_container", "input", "textarea", "select", "carousel", "html", "icon", "table", "timer", "video"],
|
|
232
|
+
enum: ["heading", "paragraph", "text", "button", "card", "image", "menu", "social", "divider", "spacer", "form_container", "input", "textarea", "select", "carousel", "html", "icon", "table", "timer", "video", "accordion", "blog_title", "blog_content", "blog_featured_image", "blog_date", "blog_author", "blog_categories", "blog_comments", "blog_post_list"],
|
|
232
233
|
},
|
|
233
234
|
style: { type: "object" },
|
|
234
235
|
attributes: {
|
|
@@ -284,6 +285,8 @@ Map the returned tokens into designJson style fields: color-type tokens into bac
|
|
|
284
285
|
name: "update_template",
|
|
285
286
|
description: `Edits an existing landing page or email template in place, under the same template ID. Recompiles and re-saves the HTML from the new designJson — the editable URL stays the same, and for a published landing page the live URL and domain are unchanged too (this does not publish/unpublish or change the domain; call publish_landing_page again with a domain for that).
|
|
286
287
|
|
|
288
|
+
This is for drag-and-drop BUILDER pages only — it REJECTS a page created via create_raw_landing_page/publish_raw_landing_page/create_landing_page_subpage's htmlContent option. Use update_raw_landing_page for those instead. If unsure which kind an existing page is, check its sourceType via list_landing_pages/get_landing_page_pages first.
|
|
289
|
+
|
|
287
290
|
Uses the SAME fully-hydrated layout schema as publish_landing_page/create_email_template — designJson MUST be { "body": { "style": {...}, "rows": [{ "id", "style", "columns": [{ "id", "width", "elements": [{ "id", "type", "style", "attributes" }] }] }] } }. There is no shorthand row format; rows without a 'columns' array are rejected, and this replaces the ENTIRE designJson — to edit one section, fetch the current template's designJson first (via list_landing_pages/list_email_templates, or the Plexo dashboard) and send back the full modified tree, not just the changed part. See publish_landing_page's description for a full worked example.`,
|
|
288
291
|
inputSchema: {
|
|
289
292
|
type: "object",
|
|
@@ -308,6 +311,30 @@ Uses the SAME fully-hydrated layout schema as publish_landing_page/create_email_
|
|
|
308
311
|
required: ["templateId", "designJson"],
|
|
309
312
|
},
|
|
310
313
|
},
|
|
314
|
+
{
|
|
315
|
+
name: "update_raw_landing_page",
|
|
316
|
+
description: `Replaces an existing RAW_UPLOAD page's HTML in place, under the same template ID — the editable URL, live URL, and domain (if published) are all unchanged. This is for pages created via create_raw_landing_page/publish_raw_landing_page/create_landing_page_subpage's htmlContent option ONLY — it REJECTS a drag-and-drop BUILDER page (use update_template for those). If unsure which kind an existing page is, check its sourceType via list_landing_pages/get_landing_page_pages first.
|
|
317
|
+
|
|
318
|
+
This replaces the ENTIRE HTML document, not a patch — send back the full modified document. Same 1MB single-document scope as create_raw_landing_page.`,
|
|
319
|
+
inputSchema: {
|
|
320
|
+
type: "object",
|
|
321
|
+
properties: {
|
|
322
|
+
templateId: {
|
|
323
|
+
type: "string",
|
|
324
|
+
description: "ID of the raw-upload page to update — the templateId returned by create_raw_landing_page, publish_raw_landing_page, list_landing_pages, or get_landing_page_pages.",
|
|
325
|
+
},
|
|
326
|
+
htmlContent: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "The FULL replacement raw HTML document (up to 1MB) — not a partial patch.",
|
|
329
|
+
},
|
|
330
|
+
name: {
|
|
331
|
+
type: "string",
|
|
332
|
+
description: "Optional new title for the page. Omit to keep the existing name.",
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
required: ["templateId", "htmlContent"],
|
|
336
|
+
},
|
|
337
|
+
},
|
|
311
338
|
{
|
|
312
339
|
name: "create_landing_page",
|
|
313
340
|
description: `Creates and saves a landing page template WITHOUT publishing it to a domain — use this when the user wants to build a page (or start a multi-page site) first and go live later. Call publish_existing_landing_page afterward with the returned templateId to link a subdomain or custom domain whenever they're ready. To create a page AND publish it in one step, use publish_landing_page instead.
|
|
@@ -328,6 +355,63 @@ Uses the SAME fully-hydrated layout schema as publish_landing_page — see its d
|
|
|
328
355
|
required: ["designJson"],
|
|
329
356
|
},
|
|
330
357
|
},
|
|
358
|
+
{
|
|
359
|
+
name: "create_raw_landing_page",
|
|
360
|
+
description: `Creates a landing page from a RAW HTML document you supply directly, WITHOUT publishing it to a domain — for when the user wants a page built from hand-written or externally-sourced HTML/CSS/JS instead of Plexo's drag-and-drop builder. The page is served byte-for-byte as given, completely unsanitized (no designJson, no compilation) — this is a DIFFERENT storage mode from create_landing_page/publish_landing_page/update_template, which are for the drag-and-drop BUILDER pages built from designJson. Do NOT use this tool for a page you want to build with designJson — use create_landing_page instead.
|
|
361
|
+
|
|
362
|
+
Scope: a single self-contained HTML document only (inline or CDN-linked CSS/JS), up to 1MB — no zip/multi-file sites with separate local asset files (that's a dashboard-only "import a website" feature with no MCP equivalent yet).
|
|
363
|
+
|
|
364
|
+
Because this serves unsanitized content, the account must accept the Acceptable Use Policy once — see the acceptAup argument. Call publish_existing_landing_page afterward with the returned templateId to link a subdomain or custom domain, or use publish_raw_landing_page to create and publish in one step. To edit this page's HTML later, use update_raw_landing_page (NOT update_template — that tool rejects raw-upload pages).`,
|
|
365
|
+
inputSchema: {
|
|
366
|
+
type: "object",
|
|
367
|
+
properties: {
|
|
368
|
+
name: {
|
|
369
|
+
type: "string",
|
|
370
|
+
description: "Title of the landing page (e.g. 'Kicks Store').",
|
|
371
|
+
},
|
|
372
|
+
htmlContent: {
|
|
373
|
+
type: "string",
|
|
374
|
+
description: "The full, self-contained raw HTML document to serve as-is (up to 1MB). Inline or CDN-linked CSS/JS only — no separate local asset files.",
|
|
375
|
+
},
|
|
376
|
+
acceptAup: {
|
|
377
|
+
type: "boolean",
|
|
378
|
+
description: "Pass true ONLY after explicitly telling the user this publishes unsanitized HTML/CSS/JS as-is and getting their confirmation of the Acceptable Use Policy (/legal/acceptable-use). Not needed once the account has accepted it once before.",
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
required: ["htmlContent"],
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "publish_raw_landing_page",
|
|
386
|
+
description: `Creates, and publishes to a domain, a landing page from a RAW HTML document you supply directly — the combined create+publish equivalent of create_raw_landing_page. See create_raw_landing_page's description for the unsanitized-content, AUP, and scope caveats (single self-contained HTML document, up to 1MB, no zip/multi-file sites). For drag-and-drop BUILDER pages built from designJson, use publish_landing_page instead — this tool is a different storage mode.`,
|
|
387
|
+
inputSchema: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: {
|
|
390
|
+
name: {
|
|
391
|
+
type: "string",
|
|
392
|
+
description: "Title of the landing page (e.g. 'Kicks Store').",
|
|
393
|
+
},
|
|
394
|
+
htmlContent: {
|
|
395
|
+
type: "string",
|
|
396
|
+
description: "The full, self-contained raw HTML document to serve as-is (up to 1MB). Inline or CDN-linked CSS/JS only — no separate local asset files.",
|
|
397
|
+
},
|
|
398
|
+
acceptAup: {
|
|
399
|
+
type: "boolean",
|
|
400
|
+
description: "Pass true ONLY after explicitly telling the user this publishes unsanitized HTML/CSS/JS as-is and getting their confirmation of the Acceptable Use Policy (/legal/acceptable-use). Not needed once the account has accepted it once before.",
|
|
401
|
+
},
|
|
402
|
+
domain: {
|
|
403
|
+
type: "string",
|
|
404
|
+
description: "Subdomain slug (e.g. 'kicks') or custom domain ('kicks.com').",
|
|
405
|
+
},
|
|
406
|
+
type: {
|
|
407
|
+
type: "string",
|
|
408
|
+
enum: ["SUBDOMAIN", "CUSTOM"],
|
|
409
|
+
description: "Domain routing type. Inferred from the domain string if omitted.",
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
required: ["htmlContent", "domain"],
|
|
413
|
+
},
|
|
414
|
+
},
|
|
331
415
|
{
|
|
332
416
|
name: "publish_existing_landing_page",
|
|
333
417
|
description: `Links a subdomain or custom domain to an already-existing landing page template — for a template created via create_landing_page, or the home page of a multi-page site (see create_landing_page_subpage) once its sub-pages are ready. Unlike publish_landing_page, this does NOT create a new template — it publishes the one you already have. Every sub-page nested under templateId automatically becomes reachable at this domain too (e.g. domain.com/about) — no separate publish call is needed per sub-page.`,
|
|
@@ -353,9 +437,9 @@ Uses the SAME fully-hydrated layout schema as publish_landing_page — see its d
|
|
|
353
437
|
},
|
|
354
438
|
{
|
|
355
439
|
name: "create_landing_page_subpage",
|
|
356
|
-
description: `Adds a new page nested under an existing landing page, reachable at <site domain>/<slug> — or nested deeper (e.g. /blog/post-1) if parentTemplateId is itself a sub-page rather than the home page. This is how a single landing page becomes a multi-page site. No separate publish step is needed for sub-pages: they automatically become reachable once the site's home page has a domain linked (see publish_existing_landing_page). Requires an Ultra subscription plan — sub-pages are otherwise unlimited per site once enabled.
|
|
440
|
+
description: `Adds a new page nested under an existing landing page, reachable at <site domain>/<slug> — or nested deeper (e.g. /blog/post-1) if parentTemplateId is itself a sub-page rather than the home page. This is how a single landing page becomes a multi-page site (BUILDER and RAW_UPLOAD pages can be freely mixed within the same site — each page's own sourceType is independent of its siblings). No separate publish step is needed for sub-pages: they automatically become reachable once the site's home page has a domain linked (see publish_existing_landing_page). Requires an Ultra subscription plan — sub-pages are otherwise unlimited per site once enabled.
|
|
357
441
|
|
|
358
|
-
|
|
442
|
+
Provide htmlContent for a raw-HTML sub-page (same unsanitized/AUP/1MB caveats as create_raw_landing_page). Omit it to create a blank BUILDER page — fill it in afterward with update_template using the returned templateId. Edit an existing sub-page's content afterward with update_template (BUILDER) or update_raw_landing_page (RAW_UPLOAD) depending on which mode it was created with.`,
|
|
359
443
|
inputSchema: {
|
|
360
444
|
type: "object",
|
|
361
445
|
properties: {
|
|
@@ -371,6 +455,14 @@ The new page starts blank — use update_template with the returned templateId t
|
|
|
371
455
|
type: "string",
|
|
372
456
|
description: "Optional URL segment (e.g. 'about-us'). Auto-generated from name if omitted; auto-suffixed (about-us-2, ...) if it collides with a sibling page under the same parent.",
|
|
373
457
|
},
|
|
458
|
+
htmlContent: {
|
|
459
|
+
type: "string",
|
|
460
|
+
description: "Optional. A full, self-contained raw HTML document (up to 1MB) to serve as-is. Creates a RAW_UPLOAD sub-page instead of a blank BUILDER one.",
|
|
461
|
+
},
|
|
462
|
+
acceptAup: {
|
|
463
|
+
type: "boolean",
|
|
464
|
+
description: "Only relevant when htmlContent is given. Pass true ONLY after explicitly telling the user this publishes unsanitized HTML/CSS/JS as-is and getting their confirmation of the Acceptable Use Policy (/legal/acceptable-use). Not needed once the account has accepted it once before.",
|
|
465
|
+
},
|
|
374
466
|
},
|
|
375
467
|
required: ["parentTemplateId", "name"],
|
|
376
468
|
},
|
|
@@ -503,6 +595,7 @@ To edit a page's CONTENT (designJson), use update_template with the same templat
|
|
|
503
595
|
},
|
|
504
596
|
},
|
|
505
597
|
},
|
|
598
|
+
...BLOG_TOOL_DEFS,
|
|
506
599
|
],
|
|
507
600
|
};
|
|
508
601
|
});
|
|
@@ -574,6 +667,42 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
574
667
|
};
|
|
575
668
|
}
|
|
576
669
|
|
|
670
|
+
case "create_raw_landing_page": {
|
|
671
|
+
const result = await client.createRawLandingPage(args as any);
|
|
672
|
+
return {
|
|
673
|
+
content: [
|
|
674
|
+
{
|
|
675
|
+
type: "text",
|
|
676
|
+
text: JSON.stringify(result, null, 2),
|
|
677
|
+
},
|
|
678
|
+
],
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
case "publish_raw_landing_page": {
|
|
683
|
+
const result = await client.publishRawLandingPage(args as any);
|
|
684
|
+
return {
|
|
685
|
+
content: [
|
|
686
|
+
{
|
|
687
|
+
type: "text",
|
|
688
|
+
text: JSON.stringify(result, null, 2),
|
|
689
|
+
},
|
|
690
|
+
],
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
case "update_raw_landing_page": {
|
|
695
|
+
const result = await client.updateRawLandingPage(args as any);
|
|
696
|
+
return {
|
|
697
|
+
content: [
|
|
698
|
+
{
|
|
699
|
+
type: "text",
|
|
700
|
+
text: JSON.stringify(result, null, 2),
|
|
701
|
+
},
|
|
702
|
+
],
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
|
|
577
706
|
case "publish_existing_landing_page": {
|
|
578
707
|
const result = await client.publishExistingLandingPage(args as any);
|
|
579
708
|
return {
|
|
@@ -720,8 +849,20 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
720
849
|
};
|
|
721
850
|
}
|
|
722
851
|
|
|
723
|
-
default:
|
|
852
|
+
default: {
|
|
853
|
+
if (BLOG_TOOL_NAMES.has(name)) {
|
|
854
|
+
const result = await handleBlogToolCall(name, (args as any) || {}, client);
|
|
855
|
+
return {
|
|
856
|
+
content: [
|
|
857
|
+
{
|
|
858
|
+
type: "text",
|
|
859
|
+
text: JSON.stringify(result, null, 2),
|
|
860
|
+
},
|
|
861
|
+
],
|
|
862
|
+
};
|
|
863
|
+
}
|
|
724
864
|
throw new Error(`Unknown tool: ${name}`);
|
|
865
|
+
}
|
|
725
866
|
}
|
|
726
867
|
} catch (error) {
|
|
727
868
|
return {
|