@wix/mcp 1.0.88 → 1.0.90

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.
@@ -30452,6 +30452,31 @@ async function fetchArticle(articleUrl) {
30452
30452
  return fetchArticleContent(httpClient6, articleUrl, "article", false);
30453
30453
  }
30454
30454
  var DOCS_URL_PREFIX = "https://dev.wix.com/docs/";
30455
+ var SKILLS_REGISTRY_URL = new RegExp(
30456
+ "^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)"
30457
+ );
30458
+ function isSkillsRegistryUrl(url) {
30459
+ return SKILLS_REGISTRY_URL.test(url.trim());
30460
+ }
30461
+ async function fetchSkillsRegistryPage(httpClient6, url) {
30462
+ let data;
30463
+ try {
30464
+ ({ data } = await httpClient6.get(url, {
30465
+ headers: { accept: "text/markdown, text/plain;q=0.9, */*;q=0.1" }
30466
+ }));
30467
+ } catch (error2) {
30468
+ const { message, status } = getHttpErrorDetails(error2);
30469
+ const statusSuffix = status ? ` (status ${status})` : "";
30470
+ throw new Error(`${message}${statusSuffix}`);
30471
+ }
30472
+ if (typeof data !== "string") {
30473
+ return JSON.stringify(data, null, 2);
30474
+ }
30475
+ if (!data.trim()) {
30476
+ throw new Error("Article content is empty");
30477
+ }
30478
+ return data;
30479
+ }
30455
30480
  function getResponseErrorMessage(data) {
30456
30481
  if (!data) {
30457
30482
  return void 0;
@@ -30542,13 +30567,15 @@ async function fetchArticleContent(httpClient6, articleUrl, mode, stripHeader =
30542
30567
  `[fetch] Override failed for ${effectiveUrl}, falling back to ${articleUrl}:`,
30543
30568
  error2 instanceof Error ? error2.message : error2
30544
30569
  );
30545
- content = await fetchArticleContentFromDigor(
30570
+ content = isSkillsRegistryUrl(articleUrl) ? await fetchSkillsRegistryPage(httpClient6, articleUrl) : await fetchArticleContentFromDigor(
30546
30571
  httpClient6,
30547
30572
  articleUrl,
30548
30573
  mode,
30549
30574
  stripHeader
30550
30575
  );
30551
30576
  }
30577
+ } else if (isSkillsRegistryUrl(articleUrl)) {
30578
+ content = await fetchSkillsRegistryPage(httpClient6, articleUrl);
30552
30579
  } else if (mode === "raw") {
30553
30580
  let parsedUrl;
30554
30581
  try {
@@ -30901,6 +30928,7 @@ function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance
30901
30928
  "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.",
30902
30929
  "**Exception \u2014 creating a new Wix site/website:** For a normal creation request \u2014 and only then \u2014 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.",
30903
30930
  "If the user explicitly asks for a headless site, Wix Classic Editor site, or manual account/API-based site creation, call CreateWixBusinessGuide right away \u2014 these don't need the site's purpose first.",
30931
+ "If the user \u2014 or you, earlier in this conversation \u2014 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 DeployWebsite right away \u2014 not a site-creation tool, not the docs.",
30904
30932
  "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."
30905
30933
  );
30906
30934
  }
@@ -30982,7 +31010,7 @@ var SITE_CREATION_COPY = {
30982
31010
  var SITE_GUIDANCE = dedent_default`
30983
31011
  A new-site request has 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.
30984
31012
 
30985
- One case skips all of this: the user ALREADY HAS the finished site as files — hand-written HTML/CSS/JS, a zip, or the export of an AI builder. There is nothing to build, so don't offer AI or templates and don't call any site-creation tool. For a full agentic flow, read the recipe first and publish the files yourself: https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md — it walks you through creating the site and uploading the files end to end. If you can't follow it, or it doesn't apply (you can't reach the file bytes, or something fails), fall back to sending the user to https://www.wix.com/headless/drop?utm_campaign=mcp — they drag the files in and get a live Wix-hosted site. Give that URL exactly as written, keeping the utm_campaign=mcp parameter.
31013
+ One case skips all of this: a finished page or site ALREADY EXISTS, in any form — hand-written HTML/CSS/JS, a static build, a zip, another AI builder's export, or a page you made earlier in this conversation. There is nothing to build, so don't offer AI or templates and don't call any site-creation tool: call DeployWebsite, which returns the recipe to publish the files yourself (the drop page is only its fallback).
30986
31014
 
30987
31015
  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.
30988
31016
  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.
@@ -31066,32 +31094,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
31066
31094
  request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
31067
31095
  // Build a multipart/form-data body from files (defaults to the \`files\`
31068
31096
  // global). Each file becomes a part named fieldName (default "files") with
31069
- // its path as the filename. Pass body + contentType to wix.request.
31097
+ // its path as the filename; \`body\` is bytes so binary parts stay intact.
31098
+ // Pass a base64 entry for binary (an image/font): { path, base64 }, or a
31099
+ // \`files\`-param entry tagged \`base64\`.
31070
31100
  multipart(
31071
- files?: Array<{ path: string; content: string; contentType?: string }>,
31101
+ files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
31072
31102
  options?: { fieldName?: string }
31073
- ): { body: string; contentType: string };
31103
+ ): { body: Uint8Array; contentType: string };
31104
+ // Unzip a downloaded site archive (base64 string or bytes) into entries with
31105
+ // RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
31106
+ // passed straight back to wix.multipart() for a re-upload.
31107
+ unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
31074
31108
  };
31075
31109
  declare const siteId: string | undefined;
31076
- // Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
31077
- declare const files: Array<{ path: string; content: string }>;
31110
+ // Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
31111
+ // an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
31112
+ // base64 \`content\` (a binary file — image, font).
31113
+ declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
31078
31114
  \`\`\`
31079
31115
 
31080
- FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
31116
+ 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):
31081
31117
  \`\`\`javascript
31082
- // files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
31118
+ // files param:
31119
+ // === FILE: index.html ===
31120
+ // <!doctype html><img src="logo.png">...
31121
+ // === FILE: logo.png base64 ===
31122
+ // iVBORw0KGgoAAA...
31083
31123
  async () => {
31084
- const mp = wix.multipart(); // parts named "files", filename = each path
31085
- const res = await wix.request({
31086
- scope: "account",
31087
- method: "POST",
31088
- url: "https://www.wixapis.com/.../upload",
31089
- headers: { "Content-Type": mp.contentType },
31090
- body: mp.body
31091
- });
31124
+ const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
31125
+ const res = await wix.request({ scope: "account", method: "POST",
31126
+ url: "https://www.wixapis.com/.../drop",
31127
+ headers: { "Content-Type": mp.contentType }, body: mp.body });
31092
31128
  return res.data;
31093
31129
  }
31094
31130
  \`\`\`
31131
+ 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()\`:
31132
+ \`\`\`javascript
31133
+ const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
31134
+ const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
31135
+ const edited = entries.map(e => e.path === "index.html"
31136
+ ? { path: e.path, content: e.text().replace("Old title", "New title") }
31137
+ : e); // images etc. pass through untouched as bytes
31138
+ const mp = wix.multipart(edited);
31139
+ \`\`\`
31095
31140
  `;
31096
31141
  var EXECUTE_WIX_API_WQL = dedent_default`
31097
31142
  For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
@@ -31223,6 +31268,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31223
31268
  ReadFullDocsArticle: dedent_default`
31224
31269
  Fetches the full Wix docs article or method article with code examples for using the method.
31225
31270
  Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
31271
+ 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.
31226
31272
  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.
31227
31273
  For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
31228
31274
  ${reminder}
@@ -31230,7 +31276,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31230
31276
  ReadFullDocsMethodSchema: dedent_default`
31231
31277
  Fetches the full method schema for a given method.
31232
31278
  This will give you the entire request/response schema with all the fields and their descriptions.
31233
- For REST API methods, prefer SearchWixAPISpec when it is available: it can fetch and inspect the exact method schema by docs URL, return the request/response shape, and inspect selected nested component schemas without dumping unrelated fields. Use ReadFullDocsMethodSchema for REST only when SearchWixAPISpec is unavailable or did not provide the needed detail.
31279
+ For REST and SDK API-reference methods, prefer SearchWixAPISpec when it is available: it can fetch and inspect the exact method schema by docs URL, return the request/response shape, the JavaScript SDK call (\`method.sdk\`: package, namespace, method, positional parameters, examples), and inspect selected nested component schemas without dumping unrelated fields. Use ReadFullDocsMethodSchema only when SearchWixAPISpec is unavailable or did not provide the needed detail.
31234
31280
  For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
31235
31281
  ${reminder}
31236
31282
  `,
@@ -31356,7 +31402,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31356
31402
  `,
31357
31403
  "import-claude-design-from-url": dedent_default`
31358
31404
  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.
31359
- NOT for site files the user provides themselves (their own HTML/CSS/JS, a zip, another builder's export) — for those, don't call this tool. For a full agentic flow, read the recipe and publish the files yourself: https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md — it covers creating the site and uploading the files end to end. If you can't follow it, or it doesn't apply, fall back to sending the user to https://www.wix.com/headless/drop?utm_campaign=mcp, where they upload the files and get a live hosted site. Give that URL exactly as written, keeping the utm_campaign=mcp parameter.
31405
+ 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 DeployWebsite instead; it returns the recipe to publish the files yourself.
31360
31406
  `,
31361
31407
  RunWixCliCommand: dedent_default`
31362
31408
  Executes Wix CLI commands for Wix app development and management.
@@ -31385,6 +31431,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31385
31431
  `,
31386
31432
  SearchWixSDKDocumentation: dedent_default`
31387
31433
  Searches the Wix JavaScript SDK documentation.
31434
+ Next step for an API-reference method it returns: pass its docs URL (with or without \`?apiView=SDK\`) to \`SearchWixAPISpec\`'s \`getResourceSchemaByUrl\` when available, and read \`method.sdk\` for the exact import, call signature, typed parameters, return type, and examples.
31388
31435
  `,
31389
31436
  SearchBuildAppsDocumentation: dedent_default`
31390
31437
  Searches the Wix Build Apps documentation.
@@ -31397,18 +31444,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31397
31444
  SearchWixHeadlessDocumentation: dedent_default`
31398
31445
  Searches the Wix Headless documentation.
31399
31446
  `,
31400
- // Note: The raw schema also contains sdkData (JS SDK package name, namespace, and
31401
- // code examples) but it's intentionally omitted from the tool description. Currently
31402
- // this MCP is focused on REST API calls via ExecuteWixAPI. We may want to expose
31403
- // sdkData in the future — needs further thought on use cases and presentation.
31447
+ // Note: each method also carries its JavaScript SDK facet (`method.sdk`: package,
31448
+ // namespace, method name, positional signature, parameter schema, JS examples),
31449
+ // merged at spec-sync time from the docs' SDK view. REST fields are unchanged;
31450
+ // `sdk` is simply absent on methods the SDK docs don't list.
31404
31451
  SearchWixAPISpec: dedent_default`
31405
- Inspect the Wix REST API spec by writing JavaScript code that runs in a sandboxed read-only environment.
31406
- **Precondition:** you already have a method \`docsUrl\` — from \`SearchWixRESTDocumentation\`, \`BrowseWixRESTDocsMenu\`, \`ReadFullDocsArticle\`, ${includeReadme ? "a `WixREADME` recipe, " : ""}or a prior tool result / the user's message in this conversation. If you don't have one yet, call \`SearchWixRESTDocumentation\` FIRST to discover it; do not use this tool to search for or choose an endpoint.
31452
+ Inspect the Wix REST API spec, and the JavaScript SDK call for each method, by writing JavaScript code that runs in a sandboxed read-only environment.
31453
+ **Precondition:** you already have a method \`docsUrl\` — from \`SearchWixRESTDocumentation\`, \`SearchWixSDKDocumentation\` (its \`?apiView=SDK\` URLs work here as-is), \`BrowseWixRESTDocsMenu\`, \`ReadFullDocsArticle\`, ${includeReadme ? "a `WixREADME` recipe, " : ""}or a prior tool result / the user's message in this conversation. If you don't have one yet, call \`SearchWixRESTDocumentation\` (or \`SearchWixSDKDocumentation\` when writing SDK code) FIRST to discover it; do not use this tool to search for or choose an endpoint.
31407
31454
  **Never pass a \`docsUrl\` you produced from memory.** If the exact URL you are about to pass to \`getResourceSchemaByUrl\` did not appear verbatim in an earlier tool result (or the user's message), it is a guess — call \`SearchWixRESTDocumentation\` first and use a URL from its ranked results. A guessed URL that merely looks plausible routinely resolves to the WRONG sibling method (e.g. \`.../products-v3/create-product\` when the task needs \`.../products-v3/create-product-with-inventory\`), sending the whole turn down a dead end. When in doubt, discover — don't guess.
31408
- **This tool's job is to INSPECT the exact schema of a method you have ALREADY located — its request/response shape, nested types, and enums. It is NOT a discovery tool for choosing which method to use.**
31455
+ **This tool's job is to INSPECT the exact schema of a method you have ALREADY located — its request/response shape, nested types, and enums, and its SDK call (\`method.sdk\`). It is NOT a discovery tool for choosing which method to use.**
31409
31456
  With a method \`docsUrl\` in hand, call \`getResourceSchemaByUrl(methodDocsUrl)\` to get the resource schema, then read the target method from \`schema.methods\` and resolve any nested \`{ $circular: name }\` types via \`schema.components.schemas[name]\`.
31410
31457
  **If you don't already have a \`docsUrl\` in context, your FIRST action MUST be \`SearchWixRESTDocumentation\` (ranked semantic search) — not this tool.** Then pass the resulting \`docsUrl\` to \`getResourceSchemaByUrl\` here. Do NOT discover endpoints by hand-filtering or scanning \`lightIndex\` (e.g. \`lightIndex.filter(...)\` / \`lightIndex.flatMap(...)\` on a substring): it has no relevance ranking, matches only at resource-name granularity, and misses composite or method-level operations whose parent resource is named after a different noun than your intent. \`lightIndex\` is for resolving a \`docsUrl\` you already have, not for finding one.
31411
- Prefer \`SearchWixAPISpec\` over \`ReadFullDocsMethodSchema\` for REST method schemas when it is available, especially once you already have a docs URL from semantic search, menu browsing, or conversation context.
31458
+ Prefer \`SearchWixAPISpec\` over \`ReadFullDocsMethodSchema\` for REST and SDK method schemas when it is available, especially once you already have a docs URL from semantic search, menu browsing, or conversation context.
31412
31459
 
31413
31460
  Prefer URL-first results:
31414
31461
  - If you have a docs URL or partial docs URL, search \`resource.docsUrl\` and \`method.docsUrl\` first.
@@ -31416,7 +31463,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31416
31463
  - For API execution, return and use \`method.publicUrl\` when available. It is the preferred executable \`https://www.wixapis.com/...\` URL.
31417
31464
  - Return \`docsUrl\` for relevant resources/methods when the next step needs an article or API call source URL; do not hand off to \`ReadFullDocsMethodSchema\` just to inspect a REST method schema.
31418
31465
  - Use \`resourceId\` only as the internal handle for low-level loaders; prefer URL helpers when you have a docs URL.
31419
- - \`getResourceSchemaByUrl\` resolves only **API resource/method** docs (e.g. \`.../bookings/services/services-v2/create-service\`). It does NOT work on **skill** pages (\`.../skills/...\`) or **article** pages — those have no schema. For an article, use \`getArticleContentByUrl(docsUrl)\`. Never pass a \`.../skills/...\` URL (skill recipes often cross-link sibling skill pages) — use \`SearchWixRESTDocumentation\` to find the real API method instead. If a lookup misses, don't retry the same URL; rediscover it with \`SearchWixRESTDocumentation\`.
31466
+ - \`getResourceSchemaByUrl\` resolves only **API resource/method** docs (e.g. \`.../bookings/services/services-v2/create-service\`). It does NOT work on **skill** pages (\`.../skills/...\`) or **article** pages — those have no schema. For an article, use \`getArticleContentByUrl(docsUrl)\`. Never pass a \`.../skills/...\` URL (skill recipes often cross-link sibling skill pages) — read the skill page with \`ReadFullDocsArticle\`, and use \`SearchWixRESTDocumentation\` to find the real API method. If a lookup misses, don't retry the same URL; rediscover it with \`SearchWixRESTDocumentation\`.
31420
31467
 
31421
31468
  Your code has access to these globals:
31422
31469
 
@@ -31431,6 +31478,8 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31431
31478
  resourceId: string; // internal handle for getResourceSchema()
31432
31479
  docsUrl: string; // e.g. "https://dev.wix.com/docs/api-reference/.../<resource>"
31433
31480
  menuPath: string[]; // e.g. ["business-solutions", "<vertical>", "<resource>"]
31481
+ sdkPackage?: string; // JS SDK npm package shared by the resource's methods, e.g. "@wix/<vertical>"
31482
+ sdkNamespace?: string; // module exported by that package, e.g. "<resources>" — absent when the methods differ (then each method carries its own)
31434
31483
  methods: Array<{
31435
31484
  operationId: string; // e.g. "wix.<vertical>.v3.<Api>.<Operation>"
31436
31485
  summary: string; // human-readable method name
@@ -31440,6 +31489,9 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31440
31489
  publicUrl?: string; // preferred executable URL for ExecuteWixAPI, when available after spec sync
31441
31490
  publicBaseUrl?: string;
31442
31491
  description: string; // truncated to 200 chars
31492
+ sdk?: string; // the JS SDK call as the SDK docs show it, e.g. "query<Resources>(query, options)"; absent when the SDK docs don't list the method
31493
+ sdkPackage?: string; // only when the resource-level value is absent
31494
+ sdkNamespace?: string;
31443
31495
  }>;
31444
31496
  }
31445
31497
  \`\`\`
@@ -31468,8 +31520,17 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31468
31520
  legacyExamples: Array<{ // Curl examples
31469
31521
  content: { title: string; request: string; response: string };
31470
31522
  }>;
31523
+ sdk?: { // JavaScript SDK facet; absent when the SDK docs don't list the method
31524
+ package: string; // npm package, e.g. "@wix/<vertical>" → import { <namespace> } from "<package>"
31525
+ namespace: string; // module exported by the package, e.g. "<resources>"
31526
+ method: string; // SDK method name; NOT always the operation name (e.g. Data Items' InsertDataItem is "insert")
31527
+ signature: string[]; // positional parameter names in call order, e.g. ["query", "options"]
31528
+ requestBody: object | null; // same envelope as the REST requestBody; its properties ARE the parameters in \`signature\`, each typed
31529
+ responses?: object; // only when the SDK returns something other than the REST response (e.g. the created entity instead of a Create<X>Response wrapper)
31530
+ examples: Array<{ title: string; description?: string; code: string }>; // JavaScript examples from the SDK docs
31531
+ };
31471
31532
  }>;
31472
- components: { schemas: object };
31533
+ components: { schemas: object }; // REST types plus the SDK's own types; \`$circular\` names from either body resolve here, exactly as written (SDK-shaped copies of shared types are keyed "sdk:<TypeName>")
31473
31534
  }
31474
31535
  \`\`\`
31475
31536
 
@@ -31531,6 +31592,16 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31531
31592
  - When inspecting a specific method schema (i.e. you have found a single method and are returning its details), always include \`responses: method.responses\` alongside \`requestBody\`. Knowing the response shape up front prevents speculative re-runs of mutations just to see what the API returned.
31532
31593
  - Query/search methods: the declared map is \`method.queryMethodData.queryFieldsCapabilitiesMap\`, or \`method.searchMethodData.searchFieldsCapabilitiesMap\` on search methods. Each entry declares one field's allowed \`operators\` and \`sort\` directions — a closed list, valid for that method alone, so another endpoint's map or a field's presence in the response proves nothing here. Each listed operator is valid on its own — a field takes one — so combine conditions with the logical operators instead: \`$and\` and \`$or\` take an array of expressions, \`$not\` takes one, and they can nest. They are WQL syntax rather than a field capability, so they never appear in the map, and its silence about them is no restriction. An undeclared field or unlisted operator are rejected; some endpoints instead ignore the filter or sort and return the wrong rows. \`sort: []\` means not sortable; no map means nothing is declared, so try what you need and filter in code if it isn't supported.
31533
31594
 
31595
+ JavaScript SDK (writing code with \`@wix/sdk\` and the \`@wix/*\` packages, in Wix Headless, Velo, CLI apps, or any Node/browser project):
31596
+ - Read \`method.sdk\`, not the REST fields. The REST \`requestBody\` is the wire shape; the SDK wraps it differently — fields become positional arguments, and secondary fields move into an \`options\` object — so never derive an SDK call from the REST body. \`sdk.requestBody.properties\` are the parameters, in the order given by \`sdk.signature\`; \`sdk.requestBody.required\` says which are mandatory.
31597
+ - The call is \`<namespace>.<method>(<signature>)\` after \`import { <namespace> } from "<package>"\` (e.g. \`import { services } from "@wix/bookings"\`), or \`wixClient.<namespace>.<method>(...)\` on a client created with \`createClient({ modules: { <namespace> } })\`. \`sdk.method\` is the only reliable method name — it is not always the camelCased operation name.
31598
+ - Return value: \`await\` resolves to \`sdk.responses\` when present, otherwise to the same shape as \`method.responses\`. Resolve \`$circular\` names from either body against \`schema.components.schemas\` exactly as written: an SDK body may point at an SDK-shaped copy of a type, keyed \`"sdk:<TypeName>"\` (e.g. \`sdk:wix.bookings.services.v2.Service\`), which sits in the same dictionary.
31599
+ - Field names differ from REST on entity system fields: the SDK reads and writes \`_id\`, \`_createdDate\`, \`_updatedDate\` where REST has \`id\`, \`createdDate\`, \`updatedDate\`. The SDK-shaped types already use the SDK names — take field names from them, never from the REST body or a REST-keyed type.
31600
+ - Timestamps: where a REST field is a \`date-time\` string, the SDK takes and returns a JavaScript \`Date\` object (the SDK types spell this \`type: "Date"\`).
31601
+ - \`sdk.examples[].code\` are the SDK docs' JavaScript examples; prefer adapting one over composing a call from the schema. Query methods use the same WQL \`filter\`/\`sort\` rules and the same \`queryMethodData\` map as REST.
31602
+ - No \`method.sdk\` means the SDK docs don't list that method: say so and offer the REST call instead of guessing an SDK signature. Where the method is listed, \`lightIndex\` carries the same call compactly as \`method.sdk\` (a string), with the package and namespace on the resource.
31603
+ - For ExecuteWixAPI, keep using \`method.publicUrl\` and the REST \`requestBody\`; the SDK facet is for code the user will run, not for calls made through this MCP.
31604
+
31534
31605
  Examples:
31535
31606
 
31536
31607
  Inspect one method schema by exact docs URL:
@@ -31575,6 +31646,39 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31575
31646
  }
31576
31647
  \`\`\`
31577
31648
 
31649
+ Get the JavaScript SDK call for a method — import, signature, typed parameters, return type, and a docs example (the docs URL may come from \`SearchWixSDKDocumentation\`, with or without \`?apiView=SDK\`):
31650
+ \`\`\`javascript
31651
+ async function() {
31652
+ const methodUrl = "https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products?apiView=SDK";
31653
+
31654
+ const schema = await getResourceSchemaByUrl(methodUrl);
31655
+ const method = schema.methods.find(method => method.docsUrl === methodUrl.replace(/\\?.*$/, ""));
31656
+ if (!method) return { message: "No exact method URL match", methods: schema.methods.map(m => ({ title: m.summary, docsUrl: m.docsUrl, sdk: m.sdk && m.sdk.method })) };
31657
+ if (!method.sdk) return { message: "The SDK docs do not list this method; use the REST call.", publicUrl: method.publicUrl, requestBody: method.requestBody };
31658
+
31659
+ const { sdk } = method;
31660
+ const types = schema.components.schemas;
31661
+ // Each positional parameter, typed. The parameters body is pre-expanded for a method URL;
31662
+ // any remaining { $circular: name } resolves against types[name].
31663
+ const paramsSchema = sdk.requestBody?.content?.["application/json"]?.schema ?? {};
31664
+ const parameters = sdk.signature.map(name => ({
31665
+ name,
31666
+ required: (paramsSchema.required ?? []).includes(name),
31667
+ schema: paramsSchema.properties?.[name]
31668
+ }));
31669
+
31670
+ return {
31671
+ import: \`import { \${sdk.namespace} } from "\${sdk.package}";\`,
31672
+ call: \`\${sdk.namespace}.\${sdk.method}(\${sdk.signature.join(", ")})\`,
31673
+ parameters,
31674
+ returns: sdk.responses ?? method.responses,
31675
+ // Query methods: the same closed list of filterable/sortable fields applies to the SDK call.
31676
+ queryFieldsCapabilities: method.queryMethodData?.queryFieldsCapabilitiesMap,
31677
+ example: sdk.examples[0]
31678
+ };
31679
+ }
31680
+ \`\`\`
31681
+
31578
31682
  Inspect one resource by resource docs URL:
31579
31683
  \`\`\`javascript
31580
31684
  async function() {
@@ -31779,11 +31883,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31779
31883
  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.
31780
31884
  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.
31781
31885
  Set \`hasMutations: true\` for any document containing a mutation root field.
31886
+ `,
31887
+ DeployWebsite: dedent_default`
31888
+ 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: 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, or upload my site / index.html.
31889
+ Also for updating a site deployed this way (replace its files; same site, same URL) and for implementing a backend on one (stores, bookings, CMS, members) 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.
31890
+ 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).
31891
+ Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
31892
+ 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).
31782
31893
  `,
31783
31894
  CreateWixBusinessGuide: dedent_default`
31784
31895
  Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
31785
31896
  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\`.
31786
- Exception, even when the user says "headless": if they ALREADY HAVE the finished site as files (their own HTML/CSS/JS, a zip, an AI-builder export) and want those files hosted, don't call this tool. For a full agentic flow, read the recipe and publish the files yourself: https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md — it covers creating the site and uploading the files end to end. If you can't follow it, or it doesn't apply, fall back to sending the user to https://www.wix.com/headless/drop?utm_campaign=mcp to upload the files and get a live hosted site (give that URL exactly, keeping the utm_campaign=mcp parameter). This guide's CLI flow is for BUILDING a headless frontend, not for hosting ready-made files.
31897
+ 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 DeployWebsite, 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.
31787
31898
 
31788
31899
  ## What This Tool Contains
31789
31900
 
@@ -32511,7 +32622,7 @@ var paramDescriptions = {
32511
32622
  reason: "One sentence describing the original user request and the task you are trying to accomplish with this search."
32512
32623
  },
32513
32624
  ReadFullDocsArticle: {
32514
- articleUrl: "The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../... 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)."
32625
+ articleUrl: "The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../... 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). Wix skills pages (https://www.wix.com/skills/..., https://dev.wix.com/docs/skills/...) are read as-is, including their referenced files."
32515
32626
  },
32516
32627
  ReadFullDocsMethodSchema: {
32517
32628
  articleUrl: "The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../... 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).",
@@ -32930,6 +33041,59 @@ ${articleContent}${nextSteps}`;
32930
33041
  );
32931
33042
  }
32932
33043
 
33044
+ // src/docs/deploy-website.ts
33045
+ var DEPLOY_WEBSITE_TOOL_NAME = "DeployWebsite";
33046
+ var DEPLOY_WEBSITE_RECIPE_URL = "https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md";
33047
+ var DROP_PAGE_URL = "https://www.wix.com/headless/drop?utm_campaign=mcp";
33048
+ var FALLBACK_LINE = `Only if you cannot run it (you can't reach the file bytes, or a step fails and you can't fix it): send the user to ${DROP_PAGE_URL} \u2014 give that URL exactly as written, keeping the utm_campaign=mcp parameter.`;
33049
+ function deployWebsiteResponse(recipe) {
33050
+ return [
33051
+ `The following is the content of ${DEPLOY_WEBSITE_RECIPE_URL}. Follow it end to end and do the publishing yourself \u2014 do not hand the user instructions.`,
33052
+ FALLBACK_LINE,
33053
+ "---",
33054
+ recipe.trim()
33055
+ ].join("\n\n");
33056
+ }
33057
+ var DEPLOY_WEBSITE_POINTER_RESPONSE = [
33058
+ `Read and follow this recipe end to end: ${DEPLOY_WEBSITE_RECIPE_URL}`,
33059
+ "It covers creating the site and uploading the files (with or without a Wix login), updating a site deployed this way, and implementing a backend on it (stores, bookings, CMS, members) as a Wix Headless project. Do the publishing yourself \u2014 do not hand the user instructions.",
33060
+ FALLBACK_LINE
33061
+ ].join("\n\n");
33062
+ function addDeployWebsiteTool(server, disableTools = [], toolDescriptions, fetchOptions = {}) {
33063
+ if (disableTools.includes(DEPLOY_WEBSITE_TOOL_NAME)) {
33064
+ return;
33065
+ }
33066
+ server.tool(
33067
+ DEPLOY_WEBSITE_TOOL_NAME,
33068
+ toolDescriptions?.[DEPLOY_WEBSITE_TOOL_NAME] ?? defaultToolDescriptions[DEPLOY_WEBSITE_TOOL_NAME],
33069
+ {},
33070
+ { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
33071
+ async (_args, { httpClient: httpClient6 }) => {
33072
+ let text = DEPLOY_WEBSITE_POINTER_RESPONSE;
33073
+ try {
33074
+ const recipe = await fetchArticleContent(
33075
+ httpClient6,
33076
+ DEPLOY_WEBSITE_RECIPE_URL.replace(/\.md$/, ""),
33077
+ "article",
33078
+ true,
33079
+ fetchOptions.skillsPortalUrl,
33080
+ fetchOptions.repo,
33081
+ fetchOptions.commitHash
33082
+ );
33083
+ if (recipe && recipe.trim()) {
33084
+ text = deployWebsiteResponse(recipe);
33085
+ }
33086
+ } catch (error2) {
33087
+ console.warn(
33088
+ `[DeployWebsite] recipe fetch failed, returning the pointer:`,
33089
+ error2 instanceof Error ? error2.message : error2
33090
+ );
33091
+ }
33092
+ return { content: [{ type: "text", text }] };
33093
+ }
33094
+ );
33095
+ }
33096
+
32933
33097
  // src/docs/docs.ts
32934
33098
  var VALID_DOCS_TOOLS = [
32935
33099
  "WDS",
@@ -32989,6 +33153,7 @@ var addDocsTools = (server, allowedTools = [
32989
33153
  const {
32990
33154
  getToKnowWixEnabled = false,
32991
33155
  createWixBusinessGuideEnabled = true,
33156
+ deployWebsiteEnabled = true,
32992
33157
  disableTools,
32993
33158
  toolDescriptions,
32994
33159
  readmeDocs,
@@ -33054,6 +33219,13 @@ var addDocsTools = (server, allowedTools = [
33054
33219
  cliEnabled
33055
33220
  );
33056
33221
  }
33222
+ if (deployWebsiteEnabled) {
33223
+ addDeployWebsiteTool(server, disableTools || [], toolDescriptions, {
33224
+ skillsPortalUrl,
33225
+ repo: effectiveRepo,
33226
+ commitHash: effectiveCommitHash
33227
+ });
33228
+ }
33057
33229
  if (allowedTools.includes("WDS") && !disableTools?.includes("SearchWixWDSDocumentation")) {
33058
33230
  server.tool(
33059
33231
  "SearchWixWDSDocumentation",
@@ -33570,18 +33742,19 @@ var addDocsTools = (server, allowedTools = [
33570
33742
  async ({ articleUrl }, { httpClient: httpClient6 }) => {
33571
33743
  const validPrefixes = ["https://dev.wix.com/docs/"];
33572
33744
  if (skillsPortalUrl) validPrefixes.push(skillsPortalUrl);
33573
- if (!validPrefixes.some((p2) => articleUrl.startsWith(p2))) {
33745
+ const isSkillsPage = isSkillsRegistryUrl(articleUrl);
33746
+ if (!isSkillsPage && !validPrefixes.some((p2) => articleUrl.startsWith(p2))) {
33574
33747
  return {
33575
33748
  isError: true,
33576
33749
  content: [
33577
33750
  {
33578
33751
  type: "text",
33579
- text: `Invalid article URL: must start with https://dev.wix.com/docs/. Got: "${articleUrl}"`
33752
+ 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}"`
33580
33753
  }
33581
33754
  ]
33582
33755
  };
33583
33756
  }
33584
- if (articleUrl.startsWith("https://dev.wix.com/docs/")) {
33757
+ if (!isSkillsPage && articleUrl.startsWith("https://dev.wix.com/docs/")) {
33585
33758
  articleUrl = articleUrl.replace(/\.md$/, "");
33586
33759
  }
33587
33760
  try {
@@ -45829,12 +46002,12 @@ function addImportClaudeDesignTool(server, authStrategy, options) {
45829
46002
  designUrl = new URL(args.url);
45830
46003
  } catch {
45831
46004
  return errorResult(
45832
- "Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For site files the user provided themselves, do not retry this tool. For a full agentic flow, read the recipe and publish the files yourself: https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md \u2014 it covers creating the site and uploading the files end to end. If you can't follow it, or it doesn't apply, send the user to https://www.wix.com/headless/drop?utm_campaign=mcp to upload them and get a live hosted site."
46005
+ "Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For a page or site that exists in any other form (the user's files, a build, a zip, another builder's export, a page you made), do not retry this tool \u2014 call DeployWebsite, which returns the recipe to publish the files yourself. If that tool isn't available: read https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md and publish them yourself, or send the user to https://www.wix.com/headless/drop?utm_campaign=mcp."
45833
46006
  );
45834
46007
  }
45835
46008
  if (designUrl.protocol !== "https:" || !designUrl.hostname.endsWith(CLAUDE_USER_CONTENT_HOST_SUFFIX)) {
45836
46009
  return errorResult(
45837
- "Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For site files the user provided themselves, do not retry this tool. For a full agentic flow, read the recipe and publish the files yourself: https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md \u2014 it covers creating the site and uploading the files end to end. If you can't follow it, or it doesn't apply, send the user to https://www.wix.com/headless/drop?utm_campaign=mcp to upload them and get a live hosted site."
46010
+ "Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For a page or site that exists in any other form (the user's files, a build, a zip, another builder's export, a page you made), do not retry this tool \u2014 call DeployWebsite, which returns the recipe to publish the files yourself. If that tool isn't available: read https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md and publish them yourself, or send the user to https://www.wix.com/headless/drop?utm_campaign=mcp."
45838
46011
  );
45839
46012
  }
45840
46013
  const accountHeaders = await authStrategy.getAccountAuthHeaders();
@@ -46947,10 +47120,11 @@ function addExecuteTool(server, options) {
46947
47120
  sourceDocUrls: external_exports.array(external_exports.string()).describe(d2.sourceDocUrls),
46948
47121
  files: external_exports.string().optional().describe(
46949
47122
  [
46950
- "Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
46951
- "Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
46952
- 'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload \u2014 e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
46953
- "Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported."
47123
+ "Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.",
47124
+ "Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:",
47125
+ '`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
47126
+ 'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
47127
+ 'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
46954
47128
  ].join(" ")
46955
47129
  ),
46956
47130
  // Visitor mode takes an agent-supplied token and pins the site; account/site