@wix/mcp 1.0.92 → 1.0.94

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.
Files changed (38) hide show
  1. package/build/bin-standalone.js +180 -212
  2. package/build/cjs/index.cjs +757 -216
  3. package/build/cjs/toolkit.cjs +725 -209
  4. package/build/dts/api-call/index.js +6 -3
  5. package/build/dts/api-call/site-files.d.ts +28 -0
  6. package/build/dts/api-call/site-files.js +194 -0
  7. package/build/dts/api-call/upload-headless-website-files.d.ts +35 -0
  8. package/build/dts/api-call/upload-headless-website-files.js +171 -0
  9. package/build/dts/bin.js +3 -6
  10. package/build/dts/code-mode/attachments.d.ts +37 -0
  11. package/build/dts/code-mode/attachments.js +218 -0
  12. package/build/dts/code-mode/index.js +53 -6
  13. package/build/dts/config/default-config.d.ts +0 -4
  14. package/build/dts/config/default-config.js +48 -56
  15. package/build/dts/config/param-descriptions.js +5 -5
  16. package/build/dts/docs/docs.d.ts +4 -2
  17. package/build/dts/docs/docs.js +25 -15
  18. package/build/dts/docs/fetch-article.js +4 -1
  19. package/build/dts/docs/get-to-know.js +1 -1
  20. package/build/dts/docs/semanticSearch.d.ts +2 -1
  21. package/build/dts/docs/semanticSearch.js +12 -5
  22. package/build/dts/docs/start-headless-build.d.ts +19 -0
  23. package/build/dts/docs/start-headless-build.js +74 -0
  24. package/build/dts/graphql/index.js +3 -1
  25. package/build/dts/import-claude-design-tool/index.js +2 -2
  26. package/build/dts/index.d.ts +1 -0
  27. package/build/dts/index.js +1 -0
  28. package/build/dts/site-widget-tools/search-site-templates-tool/index.js +17 -7
  29. package/build/dts/toolkit-entry.d.cts +4 -2
  30. package/build/dts/toolkit-entry.d.ts +4 -2
  31. package/build/dts/toolkit.js +9 -0
  32. package/build/dts/wix-mcp-server.d.ts +2 -0
  33. package/build/dts/wix-mcp-server.js +4 -0
  34. package/build/esm/index.js +755 -216
  35. package/build/esm/toolkit.js +725 -209
  36. package/package.json +2 -2
  37. package/build/dts/docs/create-site-guide.d.ts +0 -3
  38. package/build/dts/docs/create-site-guide.js +0 -109
@@ -18,7 +18,7 @@ function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance
18
18
  const exception = includeReadme ? '**Exception:** ' : '';
19
19
  const lines = [];
20
20
  if (includeReadme) {
21
- lines.push('if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.', '**Exception — creating a new Wix site/website:** For a normal creation request — and only then — skip WixREADME and the docs search, and route straight to the Wix site-creation tools available to you; their descriptions carry the routing rules. Everything else starts with WixREADME as usual.', "If the user explicitly asks for a headless site, Wix Classic Editor site, or manual account/API-based site creation, call CreateWixBusinessGuide right away — these don't need the site's purpose first.", "If the user — or you, earlier in this conversation — already have a finished page or site in any form (HTML/CSS/JS files, a static build, a zip, another builder's export, a design you can export to HTML) and want it live on Wix, call StartDeployWebsite right away — not a site-creation tool, not the docs.", "Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route normal site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI.");
21
+ lines.push('if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.', "**Creating a new Wix site — and only then — skip WixREADME and the docs.** First settle one thing: will the user keep working on this site with you, in code, or design it themselves in Wix's editor? In code — you or the user have code, the two of you designed it here, they asked you to build it, they asked for a headless site, or it is an app: StartDeployWebsite if the code exists in any form, StartHeadlessBuild if not, called right away (it only returns the guide; the site's purpose is not needed first). In Wix's editor: the site-creation tools; their descriptions carry the rules. Everything else starts with WixREADME as usual.", "Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI.");
22
22
  }
23
23
  lines.push(`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly.`);
24
24
  if (includeImageUploadGuidance) {
@@ -43,9 +43,8 @@ export function buildSystemReminder(includeReadme, includeImageUploadGuidance =
43
43
  const guidelines = buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance);
44
44
  const flows = buildSystemReminderFlows(includeReadme);
45
45
  return dedent `
46
- <agent-mandatory-instructions>
47
- YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW
48
- A FAILURE TO DO SO WILL RESULT IN ERRORS AND CRITICAL ISSUES.
46
+ <wix-usage-guide>
47
+ How to work with Wix through these tools. Following these steps avoids failed or incorrect API calls.
49
48
  <goal>
50
49
  ${AGENT_GOAL}
51
50
  </goal>
@@ -55,7 +54,7 @@ export function buildSystemReminder(includeReadme, includeImageUploadGuidance =
55
54
  <flow-description>
56
55
  ${flows}
57
56
  </flow-description>
58
- </agent-mandatory-instructions>
57
+ </wix-usage-guide>
59
58
  `;
60
59
  }
61
60
  export const SYSTEM_REMINDER = buildSystemReminder(true);
@@ -67,22 +66,17 @@ export const SITE_CREATION_COPY = {
67
66
  unstatedMethod: {
68
67
  nonWidget: 'you MUST ask whether they want to build with AI or start from a template, and create nothing and show nothing until they answer',
69
68
  widget: 'you MUST call `WixSiteCreation` and let them choose'
70
- },
71
- normalCreationRoute: {
72
- nonWidget: 'route those through `WixSiteBuilder` or `SearchSiteTemplates`',
73
- widget: 'route those through `WixSiteCreation`'
74
69
  }
75
70
  };
76
71
  /**
77
72
  * Carried by every tool that can start creating a site, so no route skips it.
78
- * `CreateWixBusinessGuide` is exempt: headless/classic/manual don't need the site's purpose.
79
73
  */
80
74
  const SITE_GUIDANCE = dedent `
81
- First decide which of two different things is being asked for:
82
- - The site is code the user or you control — hand-written HTML/CSS/JS, a static build, a zip, another AI builder's export, or a page or design you made earlier in this conversation — and it should go live on Wix. This is also the route whenever the user wants to keep working on the site here, with you: a Wix Headless site is a regular coded site, so you keep full control of the design and can change and redeploy it from this conversation at any time, and Wix business capabilities can be added to it as a backend when they are needed. Call StartDeployWebsite: it returns the recipe to host those exact files as a Wix Headless site (updates reuse the same site and URL; the drop page is only its fallback). Do not offer AI or templates for this and do not call any site-creation tool.
83
- - Wix should create the site — generated with AI from a description, or started from a template — and the user will design and edit it in Wix rather than through you. That is what the site-creation tools do; they never take files you already have.
75
+ First decide who keeps building the site:
76
+ - **You, in code**: a Wix Headless site, with full control of the design, changed and redeployed from this conversation, Wix business features added as a backend. This is the case when you or the user have code (hand-written files, a static build, a zip, another builder's export, a page you made here): call StartDeployWebsite. It is also the case when nothing is coded yet but the user asked you to build it or asked for a headless site, the two of you worked out its design in this conversation, or it is an app (a game, a dashboard, a tool): call StartHeadlessBuild right away, before asking what the site is for. Do not offer AI or templates for either.
77
+ - **The user, in Wix's editor**: Wix generates it with AI or starts it from a template, and the user designs it in Wix. That is what the site-creation tools do; they never take files you already have.
84
78
 
85
- For a new site there are two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.
79
+ For a new site in Wix's editor there are two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.
86
80
 
87
81
  Settle what the site is for first: its purpose, topic, business type, audience, or main visitor action. Naming a method is not a description of the site, and neither is the business or industry on its own.
88
82
  If you can't tell yet, ask the preferred question below and nothing else — one question, no creation-method question in the same reply, and no internal tool names.
@@ -105,6 +99,7 @@ export const toWidget = (text) => Object.values(SITE_CREATION_COPY).reduce((acc,
105
99
  */
106
100
  const EXECUTE_WIX_API_INTRO = dedent `
107
101
  Execute JavaScript code against the Wix REST API when code is useful for chaining related calls, pagination, loops, branching, or in-memory transformation.
102
+ Putting a site live or changing a headless site's files starts with StartDeployWebsite; building a new site in code with StartHeadlessBuild.
108
103
 
109
104
  CODE CONTRACT:
110
105
  - Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
@@ -182,13 +177,14 @@ const ACCOUNT_SITE_EXECUTE_SCOPE = dedent `
182
177
  unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
183
178
  };
184
179
  declare const siteId: string | undefined;
185
- // Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
186
- // an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
187
- // base64 \`content\` (a binary file — image, font).
180
+ // Files from the ExecuteWixAPI \`files\` param, followed by the resolved
181
+ // \`attachments\`. Text entries have \`content\`; an entry tagged
182
+ // \`=== FILE: <path> base64 ===\` — and every attachment, path = its file name —
183
+ // has encoding:'base64' and base64 \`content\`.
188
184
  declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
189
185
  \`\`\`
190
186
 
191
- FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
187
+ FILE UPLOADS: files never go inline in \`code\`; two params feed the \`files\` global. \`attachments\` works in ChatGPT only: pass files attached in the chat or created in your sandbox (any type, up to 10 MB per call: a zip of a whole site, HTML, images, PDFs) as you have them, by file id or /mnt/data path, all in one call. ChatGPT swaps each for \`{ download_url, file_id, file_name?, mime_type? }\` before the call reaches Wix, and the bytes arrive as base64 entries named by file name. Other clients send the value unchanged and the call fails before running; there, leave \`attachments\` out, or upload from your shell if it reaches the internet. The \`files\` param takes content you have as text here: text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
192
188
  \`\`\`javascript
193
189
  // files param:
194
190
  // === FILE: index.html ===
@@ -203,6 +199,12 @@ const ACCOUNT_SITE_EXECUTE_SCOPE = dedent `
203
199
  return res.data;
204
200
  }
205
201
  \`\`\`
202
+ A site zip passed through \`attachments\` is one base64 entry; unzip it and upload the entries:
203
+ \`\`\`javascript
204
+ // attachments: [site.zip] → files = [{ path: "site.zip", content: "<base64>", encoding: "base64" }]
205
+ const entries = await wix.unzip(files[0].content); // [{ path, bytes, text() }]
206
+ const mp = wix.multipart(entries);
207
+ \`\`\`
206
208
  DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
207
209
  \`\`\`javascript
208
210
  const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
@@ -340,7 +342,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
340
342
  ReadFullDocsArticle: dedent `
341
343
  Fetches the full Wix docs article or method article with code examples for using the method.
342
344
  Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
343
- Also reads Wix skills pages — https://www.wix.com/skills/<skill>, https://dev.wix.com/docs/skills/<skill>, and the files they link (e.g. .../<skill>/references/<file>.md) — exactly as served.
345
+ Also reads Wix skills pages — https://www.wix.com/skills/<skill>, https://dev.wix.com/docs/skills/<skill>, and the files they link (e.g. .../<skill>/references/<file>.md) — and Wix Headless agent pages under https://www.wix.com/headless/ (e.g. https://www.wix.com/headless/skill.md), exactly as served.
344
346
  Take the URL from the user's message or an earlier tool result. To reach an article you have no URL for, search or browse the docs first.
345
347
  For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
346
348
  ${reminder}
@@ -388,7 +390,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
388
390
  ${reminder}
389
391
  `,
390
392
  ManageWixSite: dedent `
391
- Use account level API in order to create a site and update a site.
393
+ Use account level API in order to update a site.
392
394
  Account-level only: this tool acts on the account itself, or on sites as objects within it, and sends no site context. Anything that reads or writes inside a site is site-level and does not belong here — use a site-level tool with that site's \`siteId\`.
393
395
  For POST/PATCH/PUT requests, pass the request body as a JSON object or array in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}} or body: [{"key": "value"}]).
394
396
  The API endpoint url param MUST ALWAYS be taken from the conversation context.
@@ -404,12 +406,12 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
404
406
  NEVER call this tool with a missing, empty, or guessed siteId — ask first instead.
405
407
 
406
408
  Parameters — provide image input via image and/or imageUrls, OR imageBase64:
407
- • image (array): chat file ATTACHMENTS. Each item is an object with download_url and file_id (both required), plus optional file_name and mime_type. Pass ALL attachments in one call.
409
+ • image (array): chat file ATTACHMENTS — files the user attached, or files you created in your own file sandbox. Each item is an object with download_url and file_id (both required), plus optional file_name and mime_type. Pass ALL attachments in one call.
408
410
  • imageUrls (array): plain public image URLs the user pasted or other tools produced (no file_id). Pass ALL URLs in one call. Can be combined with image.
409
411
  • imageBase64 (string): base64-encoded image + mimeType. One image at a time. Do NOT combine with image/imageUrls.
410
412
 
411
413
  Delivering the bytes — this is where uploads most often fail:
412
- • NEVER pass a local or sandbox file path (e.g. /mnt/..., /home/user/..., /Users/...) in any field — the server cannot reach your filesystem. Use a public http(s) URL (imageUrls) or the complete base64 (imageBase64).
414
+ • Pass a file as a file, in image: the platform resolves it into download_url and file_id before it reaches this tool — this includes files you created in your sandbox. This server does not share your filesystem, so a bare path string (e.g. /mnt/..., /home/user/..., /Users/...) is not a file. Without a file to pass, use a public http(s) URL (imageUrls) or the complete base64 (imageBase64).
413
415
  • imageBase64 must be the WHOLE file, not truncated. For large images prefer imageUrls, since long base64 is easily cut off and will be rejected as unreadable.
414
416
  `,
415
417
  SupportAndFeedback: dedent `
@@ -467,14 +469,15 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
467
469
 
468
470
  Do not call this if the user explicitly asks to build with AI; call \`WixSiteBuilder\` instead.
469
471
  Do not call this if the user asks for templates or Wix Studio; call \`SearchSiteTemplates\` instead.
472
+ Not for a site the user wants you to build in code, a design you worked out together, or an app: call \`StartHeadlessBuild\`.
470
473
 
471
474
  When calling this tool, infer \`customActions\` from the user's request so the reply can be tailored — 2-3 concrete, industry-specific setup actions for the site (see the input's guidance).
472
475
 
473
476
  After calling, you MUST speak the message provided in the tool result to the user as your reply — do not stay silent and do not replace it with a one-line pointer to the widget. Write out ALL of it, word for word: its opening line (the "Ready to set up your … site?" question INCLUDING "Choose your path in the widget above:"), BOTH of its option bullets, and its "Next up:" line, each on its own line and in that order. Do not summarize, shorten, drop any line, invent your own opener, rename the options, or add an intro or outro.
474
477
  `,
475
478
  'import-claude-design-from-url': dedent `
476
- Import a design created in Claude's design tool into Wix. Takes the signed claudeusercontent.com URL Claude Design produces for its self-contained HTML bundle (all images, fonts, and styles inlined); any other host is rejected. Creates a live Wix-hosted site and returns its URL.
477
- NOT for a page or site that exists in any other form (the user's own HTML/CSS/JS, a static build, a zip, another builder's export, a page you made in this conversation) — for those call StartDeployWebsite instead; it returns the recipe to publish the files yourself.
479
+ Import a design created in Claude's design tool into Wix. Only for the signed \`claudeusercontent.com\` bundle URL Claude Design's "Send to Wix" produces (a self-contained HTML bundle with all images, fonts, and styles inlined). Creates a live Wix-hosted site and returns its URL.
480
+ NOT for claude.ai share or artifact links, GitHub, Drive, chatgpt.com or any other URL, and not for files: those go to StartDeployWebsite, which returns the recipe to publish the files yourself.
478
481
  `,
479
482
  RunWixCliCommand: dedent `
480
483
  Executes Wix CLI commands for Wix app development and management.
@@ -911,23 +914,23 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
911
914
  Call this ONLY when the user's own words name AI (for example "create a site using AI" or "build it with AI") and the site intent is clear. A description of what the site should do — reservations, online ordering, a store, bookings, menus, a portfolio, and the like — is NOT a request for AI and NOT enough to call this tool; never infer AI from features or industry.
912
915
  Never default to this tool: if the user hasn't explicitly named AI, don't call this tool — ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.
913
916
 
914
- For templates or Wix Studio, call \`SearchSiteTemplates\`; for a specific template by \`metaSiteId\` or \`templateId\`, call \`CreateSiteFromTemplate\`; for a headless or classic Wix Editor site, or manual/account-API creation, call \`CreateWixBusinessGuide\`.
917
+ For templates or Wix Studio, call \`SearchSiteTemplates\` (\`builder: classic\` for the Classic Editor); for a template id, \`CreateSiteFromTemplate\`. A site the user wants you to build in code, or an app: \`StartHeadlessBuild\`.
915
918
 
916
919
  Do NOT suggest HTML code, prompt templates, or alternative approaches instead of building — actually build the site through this tool. (HTML the user already has is the StartDeployWebsite case, not a reason to build.)
917
920
  `,
918
921
  SearchSiteTemplates: dedent `
919
922
  ${SITE_GUIDANCE}
920
923
 
921
- Searches Wix templates and shows the template gallery, from the Harmony or the Studio template source.
924
+ Searches Wix templates and shows the template gallery, from the Harmony, the Studio or the Classic Editor template source.
922
925
 
923
- Call this ONLY when the user's own words ask for a template or for Wix Studio (for example "start from a template", "show me some templates", "build it in Wix Studio") and you can already tell what the site is for. If they mention Wix Studio, search Studio templates; otherwise search Harmony templates.
926
+ Call this ONLY when the user's own words ask for a template, for Wix Studio or for the Classic Editor (for example "start from a template", "show me some templates", "build it in Wix Studio", "the old Wix editor") and you can already tell what the site is for. If they mention Wix Studio, search Studio templates; if they ask for the Classic Editor (the Wix Editor), search \`classic\`; otherwise search Harmony templates.
924
927
  ${SITE_CREATION_COPY.templatePick.nonWidget}
925
928
 
926
929
  A description of what the site should do — bookings, a store, a menu, a portfolio, and the like — is NOT a request for templates or for Wix Studio; never infer either from features or industry. Templates are not the default: if the site intent is clear but no method is named, do not guess — ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.`,
927
930
  CreateSiteFromTemplate: dedent `
928
931
  Creates a Wix site from a specific template (by \`metaSiteId\` or \`templateId\`), publishes it when possible, and shows a live preview with links to the editor and the published site.
929
932
 
930
- Call this when the user provides a specific template by \`metaSiteId\` or \`templateId\`. Use this only when the user gives a valid \`metaSiteId\` or \`templateId\` directly. To browse or choose a template first, call \`SearchSiteTemplates\`.
933
+ Call this when the user provides a specific template by \`metaSiteId\` or \`templateId\`. Use this only when the user gives a valid \`metaSiteId\` or \`templateId\` directly. To browse or choose a template first, call \`SearchSiteTemplates\` (\`builder: classic\` for a Classic Editor site).
931
934
 
932
935
  `,
933
936
  SearchWixGraphQLOperations: dedent `
@@ -955,34 +958,24 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
955
958
  Compose: put independent reads in one document as several root fields, and use related-entity fields (e.g. \`inventoryItems\`, \`collections\`, \`fulfillments\`) instead of extra round-trips. Select only the fields you need; every object field needs a selection set. Variables: use them for \`JSON\` scalars (filter, sort) and plain scalars (String, Int, ID), declared in the document (e.g. \`query Q($f: JSON) { ... filter: $f ... }\`). Write mutation inputs and any object that contains an enum INLINE as GraphQL literals with enum values unquoted (e.g. \`input: { product: { name: "Mug", productType: PHYSICAL } }\`) — this endpoint fails with 503 when an enum value arrives inside an object-typed variable. For lists page with \`cursorPaging\` or \`paging\` exactly as the input type declares (never the other one), and request \`pageInfo { hasNext total }\`; \`total\` is only populated with offset \`paging\`, so for a cursor-paged list count by walking pages or use a count operation.
956
959
  Results: each root field fails independently — \`errors[].path\` names the failing field and \`errors[].extensions.message\` the cause (e.g. PERMISSION_DENIED); \`data\` still holds the fields that succeeded. Mutations return the created/updated entity — read the IDs from it and do not re-query to verify. Large results are truncated: narrow the selection or page size instead of re-running.
957
960
  Set \`hasMutations: true\` for any document containing a mutation root field.
961
+ `,
962
+ UploadHeadlessWebsiteFiles: dedent `
963
+ The upload step of the StartDeployWebsite and StartHeadlessBuild guides, and nothing else: puts a finished static website's files — index.html plus its CSS/JS/images, a static build, or a zip of the site — onto an existing Wix Headless site by its metaSiteId. Call it ONLY after one of them has returned its guide in this conversation and the site exists: for a new site, first run the recipe's provision call and pass the metaSiteId it returns; for a site deployed earlier, pass its metaSiteId. It does not create sites. Every upload replaces the whole file set and the URL stays. Returns the live URL and the dashboard link, and points back to the recipe for what comes next.
964
+ Pass the files themselves: in ChatGPT as \`attachments\` (any type, a zip is unpacked), elsewhere as the \`files\` text bundle (\`=== FILE: <path> ===\` sections, \`base64\` tag for small binaries). The site must contain index.html at its root.
965
+ NOT a site-creation tool: a request to create, build, design or generate a site — with or without a description — never comes here (those are the site-creation tools, after their own questions). Also NOT for media uploads to an existing site (UploadImageToWixSite) or any other API call (ExecuteWixAPI).
958
966
  `,
959
967
  StartDeployWebsite: dedent `
960
- The user — or you, earlier in this conversation — ALREADY HAVE a finished page or site, in any form, and it should be live on Wix — or an already-deployed Wix Headless site whose files should be replaced. The site can be HTML/CSS/JS files, a static build (dist/, out/), a zip, another AI builder's export, or a page/design you created in this conversation (export it to HTML first — a finished design IS a finished page). Call this when the user says deploy, host, publish, put online, make it live, get a URL, update my site, or upload my site / index.html.
968
+ The user — or you, earlier in this conversation — ALREADY HAVE a finished page or site, in any form, and it should be live on Wix — or an already-deployed Wix Headless site whose files should be replaced. The site can be HTML/CSS/JS files, a static build (dist/, out/), a zip, another AI builder's export, or a page/design you created in this conversation (export it to HTML first — a finished design IS a finished page). Call this when the user says deploy, host, put online, make it live, get a URL, upload my site / index.html, or wants to update or redeploy the files of a site you or the user deployed as code.
961
969
  Updates keep the same site and URL. Also for implementing a backend on such a site as a Wix Headless project — same site, same URL. Works with or without a Wix login (anonymous deploy with a save link), through the Wix MCP alone or from a shell.
962
970
  Missing real functionality — a fake checkout, a form that goes nowhere, bookings — is NOT a reason to rebuild the site with a site-creation tool: deploy the page as is, then add the backend afterwards (the recipe covers it).
963
- Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
964
- NOT for: a screenshot, mockup or reference image of a site the user WANTS (nothing exists to deploy yet — that is site creation: WixSiteBuilder / templates); a Claude Design share URL (import-claude-design-from-url); migrating a live site by URL or CSV exports; adding HTML or code into an existing Wix site; uploading images or documents to a site's media (UploadImageToWixSite).
971
+ Returns the full recipe; follow it and run the flow yourself. When the UploadHeadlessWebsiteFiles tool is available, use it for the recipe's upload step — after the site exists (the recipe's provision call, or a metaSiteId from an earlier deploy) — instead of building the multipart body in code; never before this tool. The drop page is only the fallback when you can't.
972
+ NOT for: a screenshot or reference of a site the user wants Wix to generate (the site-creation tools); a site described in words with no code yet (StartHeadlessBuild); a Wix editor site's content or settings (WixSiteBuilder's edit mode, or WixREADME); a Claude Design bundle URL (import-claude-design-from-url); migrating a live site by URL or CSV exports; adding HTML or code into an existing Wix site; uploading images or documents to a site's media (UploadImageToWixSite).
965
973
  `,
966
- CreateWixBusinessGuide: dedent `
967
- Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
968
- Call this ONLY when the user explicitly asks for a headless site, a Wix Classic Editor site, or manual/advanced account/API-based site creation — these don't need the site's purpose first. For normal site-creation ${SITE_CREATION_COPY.normalCreationRoute.nonWidget}; for a specific template id, call \`CreateSiteFromTemplate\`.
969
- Exception, even when the user says "headless": if a finished page or site already exists in any form (their own HTML/CSS/JS, a static build, a zip, an AI-builder export, a page you made in this conversation) and they want it hosted, don't call this tool — call StartDeployWebsite, which returns the recipe to publish the files yourself. This guide's CLI flow is for BUILDING a headless frontend, not for hosting ready-made files.
970
-
971
- ## What This Tool Contains
972
-
973
- This tool provides complete documentation including:
974
- - Template selection (empty sites or designed templates)
975
- - Wix Editor vs Wix Studio options
976
- - Regular vs Headless site creation (CLI-based; returns setup instructions)
977
- - API endpoint details and parameters
978
- - Post-creation steps (OAuth for headless, publishing for regular sites)
979
- - App installation instructions
980
-
981
- ## After Reading This Documentation
982
-
983
- **After reading this documentation:**
984
- 1. Use ManageWixSite for account-level site creation API calls
985
- 2. Use CallWixSiteAPI / ExecuteWixAPI for site-level follow-up API calls (like install apps if needed)`
974
+ StartHeadlessBuild: dedent `
975
+ The user wants a site or web app that you build and keep changing in code, here with them, and no code exists yet. Wix runs its business side (store, bookings, CMS, forms, members, payments) as a Wix Headless site. Call this when the user asks you to build it yourself rather than Wix's AI or a template; when the two of you worked out a design in this conversation and nothing is coded yet; when it is an app (a game, a dashboard, a tool); when the user asks for a headless site; when a prompt links \`wix.com/headless/skill.md\` or a project's \`download.zip\`; or to move a Wix site to code.
976
+ Call it right away: it only returns the guide, and the site's purpose is not needed first (pass "not stated yet" for what you don't know). Returns the full guide; follow it and do the work yourself, choosing its route by what you can reach (a shell that reaches Wix, or this MCP alone).
977
+ NOT for: files, a build, a zip or a page that already exist (StartDeployWebsite); a site the user will design in Wix's editor (the site-creation tools); a Claude Design URL (import-claude-design-from-url).
978
+ `
986
979
  };
987
980
  }
988
981
  /**
@@ -998,9 +991,9 @@ const recipesIndexDoc = {
998
991
  action: 'include'
999
992
  };
1000
993
  const README_INTRO = dedent `
1001
- <agent-mandatory-instructions>
994
+ <wix-usage-guide>
1002
995
 
1003
- YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW:
996
+ How to work with Wix through these tools:
1004
997
 
1005
998
  <source-of-truth>
1006
999
  Do not answer from memory about anything Wix-specific — this covers every part of your answer, not only API calls: any URL, link, ID, setting location, or product fact you give the user must come from the docs tools, the recipes below, a previous tool result in this conversation, or the user's own message (identifiers and URLs the user supplies are fine to use as given). If a recipe in the index below matches what the user asked for, read it before answering. For APIs, use the search, browse, read-docs, and schema tools as the source of truth for the exact URL, HTTP method, request body shape, response shape, field names, required fields, and enum values before calling an API.
@@ -1052,7 +1045,7 @@ const README_BODY = dedent `
1052
1045
  <other-uses>
1053
1046
  Beyond managing user sites, the Wix MCP tools can be used for any other purpose they support — for example, reading Wix SDK docs to write code against the SDK, using the Wix CLI to create apps, answering documentation questions, and so on.
1054
1047
  </other-uses>
1055
- </agent-mandatory-instructions>
1048
+ </wix-usage-guide>
1056
1049
  `;
1057
1050
  /**
1058
1051
  * Default readme docs - content for WixREADME tool response.
@@ -1129,8 +1122,7 @@ export const widgetSiteCreationConfig = {
1129
1122
  'WixSiteBuilder',
1130
1123
  'WixSiteCreation',
1131
1124
  'SearchSiteTemplates',
1132
- 'CreateSiteFromTemplate',
1133
- 'CreateWixBusinessGuide'
1125
+ 'CreateSiteFromTemplate'
1134
1126
  ].map((tool) => [tool, toWidget(defaultToolDescriptions[tool])]))
1135
1127
  };
1136
1128
  //# sourceMappingURL=default-config.js.map
@@ -73,7 +73,7 @@ export const paramDescriptions = {
73
73
  },
74
74
  SearchWixRESTDocumentation: {
75
75
  searchTerm: 'The search term to look up in the Wix REST API Documentation — a natural-language description of the endpoint, resource, or action you need across any Wix domain (Stores, eCommerce, Bookings, CRM, Members, CMS, Events, Blog, Forms, Media, site settings, etc.), e.g. "create a catalog item with inventory", "book a service", "update data collection items". Match the wording to how many entities you will act on: a plural term ("update products") surfaces the resource\'s bulk methods, which a singular term ("update a product") ranks lower or leaves out. Results are ranked by relevance, so describe the goal rather than guessing an exact API name.',
76
- maxResults: 'The maximum number of results to return, default is 10, max is 15',
76
+ maxResults: 'The maximum number of results to return (1–17, default 17). Results mix REST API documentation with matching recipes and skills.',
77
77
  reason: 'One sentence describing the original user request and the task you are trying to accomplish with this search.'
78
78
  },
79
79
  WixBusinessFlowsDocumentation: {
@@ -94,7 +94,7 @@ export const paramDescriptions = {
94
94
  },
95
95
  SearchWixHeadlessDocumentation: {
96
96
  searchTerm: 'The search term to search for in the Headless Documentation',
97
- maxResults: 'The maximum number of results to return, default is 10, max is 15'
97
+ maxResults: 'The maximum number of results to return (1–17, default 17). Results mix Headless documentation with matching recipes and skills.'
98
98
  },
99
99
  SearchWixVeloDocumentation: {
100
100
  searchTerm: 'The search term to search for in the Velo Documentation',
@@ -108,7 +108,7 @@ export const paramDescriptions = {
108
108
  ReadFullDocsArticle: {
109
109
  articleUrl: 'The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../...' +
110
110
  ' For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK).' +
111
- ' Wix skills pages (https://www.wix.com/skills/..., https://dev.wix.com/docs/skills/...) are read as-is, including their referenced files.'
111
+ ' Wix skills pages (https://www.wix.com/skills/..., https://dev.wix.com/docs/skills/...) and Wix Headless agent pages (https://www.wix.com/headless/..., e.g. https://www.wix.com/headless/skill.md) are read as-is, including their referenced files.'
112
112
  },
113
113
  ReadFullDocsMethodSchema: {
114
114
  articleUrl: 'The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../...' +
@@ -125,7 +125,7 @@ export const paramDescriptions = {
125
125
  },
126
126
  UploadImageToWixSite: {
127
127
  siteId: 'The ID (UUID) of the Wix site to upload to. REQUIRED. If the user has not clearly specified which site, ASK them which site to upload to (or use ListWixSites to help them pick) BEFORE calling this tool. NEVER call this tool with a missing, empty, placeholder, or guessed siteId — ask first instead.',
128
- image: 'Array of file ATTACHMENTS the user uploaded in the chat. Each item requires download_url and file_id, and may optionally include file_name and mime_type — attached files are automatically resolved to these fields by the platform, so just include them here. For plain image URLs the user pasted, use imageUrls instead. ALWAYS pass ALL attachments together in a single call — NEVER call this tool once per image. Do NOT use together with imageBase64.',
128
+ image: 'Array of file ATTACHMENTS: files the user uploaded in the chat, or files you created in your own file sandbox. Each item requires download_url and file_id, and may optionally include file_name and mime_type — the platform resolves a file passed here into these fields automatically, so just include the files. For plain image URLs the user pasted, use imageUrls instead. ALWAYS pass ALL attachments together in a single call — NEVER call this tool once per image. Do NOT use together with imageBase64.',
129
129
  imageUrls: 'Array of publicly accessible image URLs (e.g. links the user pasted or URLs produced by other tools). Use this for plain URLs that are NOT chat attachments — no file_id is needed. ALWAYS pass ALL URLs together in a single call. Can be combined with image; do NOT use together with imageBase64.',
130
130
  imageBase64: 'Base64-encoded image data. Use when the client can read a file and encode it as base64. May include a data URL prefix (e.g. "data:image/jpeg;base64,...") or be raw base64. Do NOT use together with image.',
131
131
  mimeType: 'MIME type of the image (e.g. "image/jpeg", "image/png", "image/webp"). Required when imageBase64 does not include a data URL prefix.',
@@ -149,7 +149,7 @@ export const paramDescriptions = {
149
149
  operationName: 'Operation to run when the document defines more than one named operation.',
150
150
  siteId: 'The Wix site to run against. Required for site-level operations (anything reading or writing inside a site — products, orders, contacts, bookings, CMS, blog, members ...). Resolve it with GetSiteContext or ListWixSites; never pass a guessed value.',
151
151
  scope: '"site" (default when siteId is given) runs with a site-scoped credential; "account" runs account-level operations (sites, account settings) and ignores siteId.',
152
- hasMutations: 'Whether this document creates, updates, deletes or otherwise mutates Wix data. True for any mutation root field (in any operation of the document) even when the intent is inspection; false only for pure queries. This flag alone decides whether a transient server error may be retried, so never mark a document that writes as false.',
152
+ hasMutations: 'True if the document contains a mutation root field in any of its operations; false if it contains only queries. A transient server error is retried only when this is false.',
153
153
  reason: 'One sentence explaining the original user request and why you are running this GraphQL operation to complete it.'
154
154
  },
155
155
  RunWixCliCommand: {
@@ -18,9 +18,12 @@ export interface ReadmeDocConfig {
18
18
  }
19
19
  export interface DocsToolsOptions {
20
20
  getToKnowWixEnabled?: boolean;
21
+ /** @deprecated CreateWixBusinessGuide was removed (StartHeadlessBuild replaces its headless route); ignored. */
21
22
  createWixBusinessGuideEnabled?: boolean;
22
23
  /** StartDeployWebsite (publish ready-made site files) — an account-owner flow; off for visitor servers. */
23
24
  startDeployWebsiteEnabled?: boolean;
25
+ /** StartHeadlessBuild (build a new site in code) — an account-owner flow; off for visitor servers. */
26
+ startHeadlessBuildEnabled?: boolean;
24
27
  disableTools?: string[];
25
28
  /** Custom descriptions for tools, keyed by tool name */
26
29
  toolDescriptions?: Record<string, string>;
@@ -44,8 +47,7 @@ export interface DocsToolsOptions {
44
47
  dynamicContextEnabled?: boolean;
45
48
  /** Enable partner context section in dynamic context output */
46
49
  partnerContextEnabled?: boolean;
47
- /** Whether the client is a CLI environment (e.g. Claude Code) where users can run terminal commands.
48
- * Accepts a boolean or a function for lazy evaluation (useful when client name is only known after MCP init). */
50
+ /** @deprecated Only CreateWixBusinessGuide read it, and that tool was removed; ignored. */
49
51
  cliEnabled?: boolean | (() => boolean);
50
52
  /** Use the new platformized semantic search API (POST /v1/docs/search) instead of the legacy GET endpoint */
51
53
  usePlatformizedSearch?: boolean;
@@ -7,7 +7,7 @@ import { normalizeMenuContent, summarizeLargeMenu, fetchMenuContent, MENU_CONTEN
7
7
  import { fetchPlatformizedMenu, MenuNotFoundError } from './browse-menu.js';
8
8
  import { isQueryOrSearchEndpoint, QUERY_CAPABILITY_MARKER } from './searchFormatting.js';
9
9
  import { addGetToKnowTools, addGetSiteContextTool } from './get-to-know.js';
10
- import { addCreateWixBusinessGuideTools } from './create-site-guide.js';
10
+ import { addStartHeadlessBuildTool } from './start-headless-build.js';
11
11
  import { addStartDeployWebsiteTool } from './start-deploy-website.js';
12
12
  import { defaultToolDescriptions } from '../config/default-config.js';
13
13
  import { desc } from '../config/param-descriptions.js';
@@ -68,7 +68,7 @@ export const addDocsTools = (server, allowedTools = [
68
68
  'CLI',
69
69
  'OVERVIEW'
70
70
  ], options = {}) => {
71
- const { getToKnowWixEnabled = false, createWixBusinessGuideEnabled = true, startDeployWebsiteEnabled = true, disableTools, toolDescriptions, readmeDocs, authStrategy, skillsPortalUrl, skillsRepo, repo, skillsPr, commitHash, skillsTags, dynamicContextEnabled, cliEnabled = false, usePlatformizedSearch = true, usePlatformizedBrowse = true } = options;
71
+ const { getToKnowWixEnabled = false, startDeployWebsiteEnabled = true, startHeadlessBuildEnabled = true, disableTools, toolDescriptions, readmeDocs, authStrategy, skillsPortalUrl, skillsRepo, repo, skillsPr, commitHash, skillsTags, dynamicContextEnabled, usePlatformizedSearch = true, usePlatformizedBrowse = true } = options;
72
72
  const effectiveRepo = repo ?? skillsRepo;
73
73
  const effectiveCommitHash = commitHash ?? skillsPr;
74
74
  // Helper to get description (custom or default)
@@ -120,10 +120,6 @@ export const addDocsTools = (server, allowedTools = [
120
120
  skillsTags
121
121
  });
122
122
  }
123
- if (createWixBusinessGuideEnabled &&
124
- !disableTools?.includes('CreateWixBusinessGuide')) {
125
- addCreateWixBusinessGuideTools(server, disableTools || [], toolDescriptions, cliEnabled);
126
- }
127
123
  // On by default: it is a routing slot, not a docs source — the agent with
128
124
  // ready-made site files must find it next to the site-creation tools.
129
125
  if (startDeployWebsiteEnabled) {
@@ -133,6 +129,14 @@ export const addDocsTools = (server, allowedTools = [
133
129
  commitHash: effectiveCommitHash
134
130
  });
135
131
  }
132
+ // Same reach as StartDeployWebsite: the slot for a site built in code with no code yet.
133
+ if (startHeadlessBuildEnabled) {
134
+ addStartHeadlessBuildTool(server, disableTools || [], toolDescriptions, {
135
+ skillsPortalUrl,
136
+ repo: effectiveRepo,
137
+ commitHash: effectiveCommitHash
138
+ });
139
+ }
136
140
  // WDS Documentation
137
141
  if (allowedTools.includes('WDS') &&
138
142
  !disableTools?.includes('SearchWixWDSDocumentation')) {
@@ -195,9 +199,9 @@ export const addDocsTools = (server, allowedTools = [
195
199
  .number()
196
200
  .describe(d.maxResults)
197
201
  .min(1)
198
- .max(15)
202
+ .max(17)
199
203
  .optional()
200
- .default(15),
204
+ .default(17),
201
205
  reason: z.string().describe(d.reason)
202
206
  };
203
207
  })(), { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults, reason }, { panorama }) => {
@@ -208,9 +212,12 @@ export const addDocsTools = (server, allowedTools = [
208
212
  toolParams: {
209
213
  searchTerm: searchTerm
210
214
  },
211
- maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),
215
+ maxResults: Math.max(1, Math.min(maxResults ?? 17, 17)),
212
216
  linesInEachResult: 30,
213
- usePlatformizedSearch
217
+ usePlatformizedSearch,
218
+ // Merge recipes/skills into the REST ranking — they live in a
219
+ // separate corpus the REST document_type doesn't cover on its own.
220
+ extraDocumentTypes: ['SKILLS']
214
221
  });
215
222
  // Only when a result actually carried the marker. Re-deriving it here would also fire on
216
223
  // an article that merely references a query endpoint, with no such endpoint in the results.
@@ -472,9 +479,9 @@ export const addDocsTools = (server, allowedTools = [
472
479
  .number()
473
480
  .describe(d.maxResults)
474
481
  .min(1)
475
- .max(15)
482
+ .max(17)
476
483
  .optional()
477
- .default(15)
484
+ .default(17)
478
485
  };
479
486
  })(), { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults }, { panorama }) => {
480
487
  try {
@@ -484,8 +491,11 @@ export const addDocsTools = (server, allowedTools = [
484
491
  toolParams: {
485
492
  searchTerm: searchTerm
486
493
  },
487
- maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),
488
- usePlatformizedSearch
494
+ maxResults: Math.max(1, Math.min(maxResults ?? 17, 17)),
495
+ usePlatformizedSearch,
496
+ // Merge recipes/skills into the headless ranking — same separate
497
+ // corpus the WIX_HEADLESS document_type doesn't cover on its own.
498
+ extraDocumentTypes: ['SKILLS']
489
499
  });
490
500
  return {
491
501
  content: [
@@ -645,7 +655,7 @@ export const addDocsTools = (server, allowedTools = [
645
655
  content: [
646
656
  {
647
657
  type: 'text',
648
- text: `Invalid article URL: must start with https://dev.wix.com/docs/, or be a Wix skills page (https://www.wix.com/skills/...). Got: "${articleUrl}"`
658
+ text: `Invalid article URL: must start with https://dev.wix.com/docs/, or be a Wix skills page (https://www.wix.com/skills/..., https://www.wix.com/headless/...). Got: "${articleUrl}"`
649
659
  }
650
660
  ]
651
661
  };
@@ -57,7 +57,10 @@ const DOCS_URL_PREFIX = 'https://dev.wix.com/docs/';
57
57
  * get-article-content API does not know them, and `.md` is a real path, so
58
58
  * they are fetched as-is.
59
59
  */
60
- const SKILLS_REGISTRY_URL = new RegExp('^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)');
60
+ const SKILLS_REGISTRY_URL = new RegExp('^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)' +
61
+ // Anything under www.wix.com/headless/ (e.g. the landing page's skill.md) is
62
+ // served as raw markdown like the registry, and read the same way.
63
+ '|^https://www\\.wix\\.com/headless/');
61
64
  export function isSkillsRegistryUrl(url) {
62
65
  return SKILLS_REGISTRY_URL.test(url.trim());
63
66
  }
@@ -66,7 +66,7 @@ export async function addGetToKnowTools({ server, disableTools = [], toolDescrip
66
66
  return;
67
67
  }
68
68
  // Use provided docs or fall back to defaults. The Recipes block is appended
69
- // at the end so the hand-authored agent-mandatory-instructions stay on top.
69
+ // at the end so the hand-authored wix-usage-guide stays on top.
70
70
  const baseDocs = readmeDocs ?? defaultReadmeDocs;
71
71
  const baseDocsWithoutRecipes = baseDocs.filter((doc) => doc.url !== RECIPES_INDEX_URL);
72
72
  server.tool('WixREADME', toolDescriptions?.['WixREADME'] ?? defaultToolDescriptions.WixREADME, {}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async (args, { httpClient }) => {
@@ -1,11 +1,12 @@
1
1
  import type { DocsTool } from './docs.js';
2
2
  export declare const DEFAULT_MAX_RESULTS = 15;
3
- export declare const runSemanticSearchAndFormat: ({ toolName, toolParams, maxResults, rerank, linesInEachResult, usePlatformizedSearch }: {
3
+ export declare const runSemanticSearchAndFormat: ({ toolName, toolParams, maxResults, rerank, linesInEachResult, usePlatformizedSearch, extraDocumentTypes }: {
4
4
  toolName: DocsTool;
5
5
  toolParams: Record<string, string>;
6
6
  maxResults?: number;
7
7
  rerank?: boolean;
8
8
  linesInEachResult?: number | undefined;
9
9
  usePlatformizedSearch?: boolean;
10
+ extraDocumentTypes?: string[];
10
11
  }) => Promise<string>;
11
12
  //# sourceMappingURL=semanticSearch.d.ts.map
@@ -70,9 +70,14 @@ const runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank =
70
70
  logger.log('Ran RAG search successfully with params', JSON.stringify(toolParams), timeTaskFormatted, typeof data);
71
71
  return data?.results;
72
72
  };
73
- const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult) => {
73
+ const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult, extraDocumentTypes) => {
74
74
  const startTime = Date.now();
75
- logger.log(`[SemanticSearch/v2] Tool: ${toolName}, Query: "${searchTerm}"`);
75
+ // When extra types are requested, search them in one combined ranking via the
76
+ // plural `document_types` field (mutually exclusive with `document_type`).
77
+ const documentTypes = extraDocumentTypes?.length
78
+ ? [toolName, ...extraDocumentTypes]
79
+ : undefined;
80
+ logger.log(`[SemanticSearch/v2] Tool: ${documentTypes ? documentTypes.join('+') : toolName}, Query: "${searchTerm}"`);
76
81
  const response = await fetch('https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown', {
77
82
  method: 'POST',
78
83
  headers: {
@@ -81,7 +86,9 @@ const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults =
81
86
  },
82
87
  body: JSON.stringify({
83
88
  search_term: searchTerm,
84
- document_type: toolName,
89
+ ...(documentTypes
90
+ ? { document_types: documentTypes }
91
+ : { document_type: toolName }),
85
92
  maximum_results: maxResults,
86
93
  lines_in_each_result: linesInEachResult
87
94
  })
@@ -98,9 +105,9 @@ const runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults =
98
105
  }
99
106
  return content;
100
107
  };
101
- export const runSemanticSearchAndFormat = async ({ toolName, toolParams, maxResults = DEFAULT_MAX_RESULTS, rerank, linesInEachResult, usePlatformizedSearch = true }) => {
108
+ export const runSemanticSearchAndFormat = async ({ toolName, toolParams, maxResults = DEFAULT_MAX_RESULTS, rerank, linesInEachResult, usePlatformizedSearch = true, extraDocumentTypes }) => {
102
109
  if (usePlatformizedSearch) {
103
- return runPlatformizedSemanticSearch(toolName, toolParams.searchTerm, maxResults, linesInEachResult);
110
+ return runPlatformizedSemanticSearch(toolName, toolParams.searchTerm, maxResults, linesInEachResult, extraDocumentTypes);
104
111
  }
105
112
  else {
106
113
  const results = await runSemanticSearch(toolName, toolParams, maxResults, rerank);
@@ -0,0 +1,19 @@
1
+ import { WixMcpServer } from '../wix-mcp-server.js';
2
+ import { type StartDeployWebsiteFetchOptions } from './start-deploy-website.js';
3
+ export declare const START_HEADLESS_BUILD_TOOL_NAME = "StartHeadlessBuild";
4
+ /** Wix's headless guide; identical to https://www.wix.com/headless/skill.md. */
5
+ export declare const HEADLESS_GUIDE_URL = "https://www.wix.com/skills/headless-cold-start/headless-kit.md";
6
+ export declare const START_HEADLESS_BUILD_STARTING_POINTS: readonly ["nothing yet", "a design worked out in this conversation", "an existing Wix Headless site", "a project download link", "a Wix site to move to code"];
7
+ type StartingPoint = (typeof START_HEADLESS_BUILD_STARTING_POINTS)[number];
8
+ export declare const START_HEADLESS_BUILD_PARAM_DESCRIPTIONS: {
9
+ readonly userRequest: "The user's request that led here, quoted if short, otherwise summarized in a sentence.";
10
+ readonly siteDescription: "What the site is: its purpose and who it is for. One or two sentences.";
11
+ readonly startingPoint: "What the build starts from: nothing yet; a design worked out in this conversation; an existing Wix Headless site; a project download link (a download.zip from Wix); or a Wix site to move to code.";
12
+ readonly siteFunctionality: "What the site must be able to do for its visitors beyond showing pages, if anything (for example selling, bookings or reservations, tickets, menus and orders, rentals, forms, memberships or paid plans, donations, a blog, or anything else the user expects to work), in your own words. If it is a plain static site with no such needs, say so.";
13
+ readonly agentIdentity: "Which agent or product you are and the harness you run in.";
14
+ readonly wixAccess: "How you can reach Wix from where you run: through this MCP only, or also from a shell whose network can reach wixapis.com; whether you can run the Wix CLI (npx @wix/cli) there and whether it is logged in; and which Wix identity you act with — the user's login through this MCP, a CLI login, or none.";
15
+ };
16
+ export declare function startHeadlessBuildResponse(guide: string | undefined, startingPoint: StartingPoint): string;
17
+ export declare function addStartHeadlessBuildTool(server: WixMcpServer, disableTools?: string[], toolDescriptions?: Record<string, string>, fetchOptions?: StartDeployWebsiteFetchOptions): void;
18
+ export {};
19
+ //# sourceMappingURL=start-headless-build.d.ts.map