@wix/mcp 1.0.89 → 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.
- package/build/bin-standalone.js +175 -19
- package/build/cjs/index.cjs +177 -21
- package/build/cjs/toolkit.cjs +175 -19
- package/build/dts/config/default-config.js +81 -15
- package/build/dts/config/param-descriptions.js +2 -1
- package/build/dts/docs/deploy-website.d.ts +13 -0
- package/build/dts/docs/deploy-website.js +45 -0
- package/build/dts/docs/docs.d.ts +2 -0
- package/build/dts/docs/docs.js +21 -7
- package/build/dts/docs/fetch-article.d.ts +1 -0
- package/build/dts/docs/fetch-article.js +40 -2
- package/build/dts/import-claude-design-tool/index.js +2 -2
- package/build/dts/toolkit-entry.d.cts +2 -0
- package/build/dts/toolkit-entry.d.ts +2 -0
- package/build/esm/index.js +177 -21
- package/build/esm/toolkit.js +175 -19
- package/package.json +2 -2
package/build/esm/toolkit.js
CHANGED
|
@@ -11696,6 +11696,31 @@ async function fetchArticle(articleUrl) {
|
|
|
11696
11696
|
return fetchArticleContent(httpClient, articleUrl, "article", false);
|
|
11697
11697
|
}
|
|
11698
11698
|
var DOCS_URL_PREFIX = "https://dev.wix.com/docs/";
|
|
11699
|
+
var SKILLS_REGISTRY_URL = new RegExp(
|
|
11700
|
+
"^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)"
|
|
11701
|
+
);
|
|
11702
|
+
function isSkillsRegistryUrl(url) {
|
|
11703
|
+
return SKILLS_REGISTRY_URL.test(url.trim());
|
|
11704
|
+
}
|
|
11705
|
+
async function fetchSkillsRegistryPage(httpClient, url) {
|
|
11706
|
+
let data;
|
|
11707
|
+
try {
|
|
11708
|
+
({ data } = await httpClient.get(url, {
|
|
11709
|
+
headers: { accept: "text/markdown, text/plain;q=0.9, */*;q=0.1" }
|
|
11710
|
+
}));
|
|
11711
|
+
} catch (error) {
|
|
11712
|
+
const { message, status } = getHttpErrorDetails(error);
|
|
11713
|
+
const statusSuffix = status ? ` (status ${status})` : "";
|
|
11714
|
+
throw new Error(`${message}${statusSuffix}`);
|
|
11715
|
+
}
|
|
11716
|
+
if (typeof data !== "string") {
|
|
11717
|
+
return JSON.stringify(data, null, 2);
|
|
11718
|
+
}
|
|
11719
|
+
if (!data.trim()) {
|
|
11720
|
+
throw new Error("Article content is empty");
|
|
11721
|
+
}
|
|
11722
|
+
return data;
|
|
11723
|
+
}
|
|
11699
11724
|
function getResponseErrorMessage(data) {
|
|
11700
11725
|
if (!data) {
|
|
11701
11726
|
return void 0;
|
|
@@ -11786,13 +11811,15 @@ async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = f
|
|
|
11786
11811
|
`[fetch] Override failed for ${effectiveUrl}, falling back to ${articleUrl}:`,
|
|
11787
11812
|
error instanceof Error ? error.message : error
|
|
11788
11813
|
);
|
|
11789
|
-
content = await fetchArticleContentFromDigor(
|
|
11814
|
+
content = isSkillsRegistryUrl(articleUrl) ? await fetchSkillsRegistryPage(httpClient, articleUrl) : await fetchArticleContentFromDigor(
|
|
11790
11815
|
httpClient,
|
|
11791
11816
|
articleUrl,
|
|
11792
11817
|
mode,
|
|
11793
11818
|
stripHeader
|
|
11794
11819
|
);
|
|
11795
11820
|
}
|
|
11821
|
+
} else if (isSkillsRegistryUrl(articleUrl)) {
|
|
11822
|
+
content = await fetchSkillsRegistryPage(httpClient, articleUrl);
|
|
11796
11823
|
} else if (mode === "raw") {
|
|
11797
11824
|
let parsedUrl;
|
|
11798
11825
|
try {
|
|
@@ -12097,6 +12124,7 @@ function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance
|
|
|
12097
12124
|
"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.",
|
|
12098
12125
|
"**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.",
|
|
12099
12126
|
"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.",
|
|
12127
|
+
"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.",
|
|
12100
12128
|
"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."
|
|
12101
12129
|
);
|
|
12102
12130
|
}
|
|
@@ -12178,7 +12206,7 @@ var SITE_CREATION_COPY = {
|
|
|
12178
12206
|
var SITE_GUIDANCE = dedent_default`
|
|
12179
12207
|
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.
|
|
12180
12208
|
|
|
12181
|
-
One case skips all of this:
|
|
12209
|
+
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).
|
|
12182
12210
|
|
|
12183
12211
|
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.
|
|
12184
12212
|
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.
|
|
@@ -12436,6 +12464,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12436
12464
|
ReadFullDocsArticle: dedent_default`
|
|
12437
12465
|
Fetches the full Wix docs article or method article with code examples for using the method.
|
|
12438
12466
|
Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
|
|
12467
|
+
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.
|
|
12439
12468
|
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.
|
|
12440
12469
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
12441
12470
|
${reminder}
|
|
@@ -12443,7 +12472,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12443
12472
|
ReadFullDocsMethodSchema: dedent_default`
|
|
12444
12473
|
Fetches the full method schema for a given method.
|
|
12445
12474
|
This will give you the entire request/response schema with all the fields and their descriptions.
|
|
12446
|
-
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
|
|
12475
|
+
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.
|
|
12447
12476
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
12448
12477
|
${reminder}
|
|
12449
12478
|
`,
|
|
@@ -12569,7 +12598,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12569
12598
|
`,
|
|
12570
12599
|
"import-claude-design-from-url": dedent_default`
|
|
12571
12600
|
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.
|
|
12572
|
-
NOT for site
|
|
12601
|
+
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.
|
|
12573
12602
|
`,
|
|
12574
12603
|
RunWixCliCommand: dedent_default`
|
|
12575
12604
|
Executes Wix CLI commands for Wix app development and management.
|
|
@@ -12598,6 +12627,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12598
12627
|
`,
|
|
12599
12628
|
SearchWixSDKDocumentation: dedent_default`
|
|
12600
12629
|
Searches the Wix JavaScript SDK documentation.
|
|
12630
|
+
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.
|
|
12601
12631
|
`,
|
|
12602
12632
|
SearchBuildAppsDocumentation: dedent_default`
|
|
12603
12633
|
Searches the Wix Build Apps documentation.
|
|
@@ -12610,18 +12640,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12610
12640
|
SearchWixHeadlessDocumentation: dedent_default`
|
|
12611
12641
|
Searches the Wix Headless documentation.
|
|
12612
12642
|
`,
|
|
12613
|
-
// Note:
|
|
12614
|
-
//
|
|
12615
|
-
//
|
|
12616
|
-
//
|
|
12643
|
+
// Note: each method also carries its JavaScript SDK facet (`method.sdk`: package,
|
|
12644
|
+
// namespace, method name, positional signature, parameter schema, JS examples),
|
|
12645
|
+
// merged at spec-sync time from the docs' SDK view. REST fields are unchanged;
|
|
12646
|
+
// `sdk` is simply absent on methods the SDK docs don't list.
|
|
12617
12647
|
SearchWixAPISpec: dedent_default`
|
|
12618
|
-
Inspect the Wix REST API spec by writing JavaScript code that runs in a sandboxed read-only environment.
|
|
12619
|
-
**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.
|
|
12648
|
+
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.
|
|
12649
|
+
**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.
|
|
12620
12650
|
**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.
|
|
12621
|
-
**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.**
|
|
12651
|
+
**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.**
|
|
12622
12652
|
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]\`.
|
|
12623
12653
|
**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.
|
|
12624
|
-
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.
|
|
12654
|
+
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.
|
|
12625
12655
|
|
|
12626
12656
|
Prefer URL-first results:
|
|
12627
12657
|
- If you have a docs URL or partial docs URL, search \`resource.docsUrl\` and \`method.docsUrl\` first.
|
|
@@ -12629,7 +12659,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12629
12659
|
- For API execution, return and use \`method.publicUrl\` when available. It is the preferred executable \`https://www.wixapis.com/...\` URL.
|
|
12630
12660
|
- 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.
|
|
12631
12661
|
- Use \`resourceId\` only as the internal handle for low-level loaders; prefer URL helpers when you have a docs URL.
|
|
12632
|
-
- \`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
|
|
12662
|
+
- \`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\`.
|
|
12633
12663
|
|
|
12634
12664
|
Your code has access to these globals:
|
|
12635
12665
|
|
|
@@ -12644,6 +12674,8 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12644
12674
|
resourceId: string; // internal handle for getResourceSchema()
|
|
12645
12675
|
docsUrl: string; // e.g. "https://dev.wix.com/docs/api-reference/.../<resource>"
|
|
12646
12676
|
menuPath: string[]; // e.g. ["business-solutions", "<vertical>", "<resource>"]
|
|
12677
|
+
sdkPackage?: string; // JS SDK npm package shared by the resource's methods, e.g. "@wix/<vertical>"
|
|
12678
|
+
sdkNamespace?: string; // module exported by that package, e.g. "<resources>" — absent when the methods differ (then each method carries its own)
|
|
12647
12679
|
methods: Array<{
|
|
12648
12680
|
operationId: string; // e.g. "wix.<vertical>.v3.<Api>.<Operation>"
|
|
12649
12681
|
summary: string; // human-readable method name
|
|
@@ -12653,6 +12685,9 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12653
12685
|
publicUrl?: string; // preferred executable URL for ExecuteWixAPI, when available after spec sync
|
|
12654
12686
|
publicBaseUrl?: string;
|
|
12655
12687
|
description: string; // truncated to 200 chars
|
|
12688
|
+
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
|
|
12689
|
+
sdkPackage?: string; // only when the resource-level value is absent
|
|
12690
|
+
sdkNamespace?: string;
|
|
12656
12691
|
}>;
|
|
12657
12692
|
}
|
|
12658
12693
|
\`\`\`
|
|
@@ -12681,8 +12716,17 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12681
12716
|
legacyExamples: Array<{ // Curl examples
|
|
12682
12717
|
content: { title: string; request: string; response: string };
|
|
12683
12718
|
}>;
|
|
12719
|
+
sdk?: { // JavaScript SDK facet; absent when the SDK docs don't list the method
|
|
12720
|
+
package: string; // npm package, e.g. "@wix/<vertical>" → import { <namespace> } from "<package>"
|
|
12721
|
+
namespace: string; // module exported by the package, e.g. "<resources>"
|
|
12722
|
+
method: string; // SDK method name; NOT always the operation name (e.g. Data Items' InsertDataItem is "insert")
|
|
12723
|
+
signature: string[]; // positional parameter names in call order, e.g. ["query", "options"]
|
|
12724
|
+
requestBody: object | null; // same envelope as the REST requestBody; its properties ARE the parameters in \`signature\`, each typed
|
|
12725
|
+
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)
|
|
12726
|
+
examples: Array<{ title: string; description?: string; code: string }>; // JavaScript examples from the SDK docs
|
|
12727
|
+
};
|
|
12684
12728
|
}>;
|
|
12685
|
-
components: { schemas: object };
|
|
12729
|
+
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>")
|
|
12686
12730
|
}
|
|
12687
12731
|
\`\`\`
|
|
12688
12732
|
|
|
@@ -12744,6 +12788,16 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12744
12788
|
- 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.
|
|
12745
12789
|
- 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.
|
|
12746
12790
|
|
|
12791
|
+
JavaScript SDK (writing code with \`@wix/sdk\` and the \`@wix/*\` packages, in Wix Headless, Velo, CLI apps, or any Node/browser project):
|
|
12792
|
+
- 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.
|
|
12793
|
+
- 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.
|
|
12794
|
+
- 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.
|
|
12795
|
+
- 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.
|
|
12796
|
+
- 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"\`).
|
|
12797
|
+
- \`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.
|
|
12798
|
+
- 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.
|
|
12799
|
+
- 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.
|
|
12800
|
+
|
|
12747
12801
|
Examples:
|
|
12748
12802
|
|
|
12749
12803
|
Inspect one method schema by exact docs URL:
|
|
@@ -12788,6 +12842,39 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12788
12842
|
}
|
|
12789
12843
|
\`\`\`
|
|
12790
12844
|
|
|
12845
|
+
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\`):
|
|
12846
|
+
\`\`\`javascript
|
|
12847
|
+
async function() {
|
|
12848
|
+
const methodUrl = "https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products?apiView=SDK";
|
|
12849
|
+
|
|
12850
|
+
const schema = await getResourceSchemaByUrl(methodUrl);
|
|
12851
|
+
const method = schema.methods.find(method => method.docsUrl === methodUrl.replace(/\\?.*$/, ""));
|
|
12852
|
+
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 })) };
|
|
12853
|
+
if (!method.sdk) return { message: "The SDK docs do not list this method; use the REST call.", publicUrl: method.publicUrl, requestBody: method.requestBody };
|
|
12854
|
+
|
|
12855
|
+
const { sdk } = method;
|
|
12856
|
+
const types = schema.components.schemas;
|
|
12857
|
+
// Each positional parameter, typed. The parameters body is pre-expanded for a method URL;
|
|
12858
|
+
// any remaining { $circular: name } resolves against types[name].
|
|
12859
|
+
const paramsSchema = sdk.requestBody?.content?.["application/json"]?.schema ?? {};
|
|
12860
|
+
const parameters = sdk.signature.map(name => ({
|
|
12861
|
+
name,
|
|
12862
|
+
required: (paramsSchema.required ?? []).includes(name),
|
|
12863
|
+
schema: paramsSchema.properties?.[name]
|
|
12864
|
+
}));
|
|
12865
|
+
|
|
12866
|
+
return {
|
|
12867
|
+
import: \`import { \${sdk.namespace} } from "\${sdk.package}";\`,
|
|
12868
|
+
call: \`\${sdk.namespace}.\${sdk.method}(\${sdk.signature.join(", ")})\`,
|
|
12869
|
+
parameters,
|
|
12870
|
+
returns: sdk.responses ?? method.responses,
|
|
12871
|
+
// Query methods: the same closed list of filterable/sortable fields applies to the SDK call.
|
|
12872
|
+
queryFieldsCapabilities: method.queryMethodData?.queryFieldsCapabilitiesMap,
|
|
12873
|
+
example: sdk.examples[0]
|
|
12874
|
+
};
|
|
12875
|
+
}
|
|
12876
|
+
\`\`\`
|
|
12877
|
+
|
|
12791
12878
|
Inspect one resource by resource docs URL:
|
|
12792
12879
|
\`\`\`javascript
|
|
12793
12880
|
async function() {
|
|
@@ -12992,11 +13079,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
12992
13079
|
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.
|
|
12993
13080
|
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.
|
|
12994
13081
|
Set \`hasMutations: true\` for any document containing a mutation root field.
|
|
13082
|
+
`,
|
|
13083
|
+
DeployWebsite: dedent_default`
|
|
13084
|
+
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.
|
|
13085
|
+
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.
|
|
13086
|
+
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).
|
|
13087
|
+
Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
|
|
13088
|
+
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).
|
|
12995
13089
|
`,
|
|
12996
13090
|
CreateWixBusinessGuide: dedent_default`
|
|
12997
13091
|
Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
|
|
12998
13092
|
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\`.
|
|
12999
|
-
Exception, even when the user says "headless": if
|
|
13093
|
+
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.
|
|
13000
13094
|
|
|
13001
13095
|
## What This Tool Contains
|
|
13002
13096
|
|
|
@@ -13724,7 +13818,7 @@ var paramDescriptions = {
|
|
|
13724
13818
|
reason: "One sentence describing the original user request and the task you are trying to accomplish with this search."
|
|
13725
13819
|
},
|
|
13726
13820
|
ReadFullDocsArticle: {
|
|
13727
|
-
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)."
|
|
13821
|
+
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."
|
|
13728
13822
|
},
|
|
13729
13823
|
ReadFullDocsMethodSchema: {
|
|
13730
13824
|
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).",
|
|
@@ -14143,6 +14237,59 @@ ${articleContent}${nextSteps}`;
|
|
|
14143
14237
|
);
|
|
14144
14238
|
}
|
|
14145
14239
|
|
|
14240
|
+
// src/docs/deploy-website.ts
|
|
14241
|
+
var DEPLOY_WEBSITE_TOOL_NAME = "DeployWebsite";
|
|
14242
|
+
var DEPLOY_WEBSITE_RECIPE_URL = "https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md";
|
|
14243
|
+
var DROP_PAGE_URL = "https://www.wix.com/headless/drop?utm_campaign=mcp";
|
|
14244
|
+
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.`;
|
|
14245
|
+
function deployWebsiteResponse(recipe) {
|
|
14246
|
+
return [
|
|
14247
|
+
`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.`,
|
|
14248
|
+
FALLBACK_LINE,
|
|
14249
|
+
"---",
|
|
14250
|
+
recipe.trim()
|
|
14251
|
+
].join("\n\n");
|
|
14252
|
+
}
|
|
14253
|
+
var DEPLOY_WEBSITE_POINTER_RESPONSE = [
|
|
14254
|
+
`Read and follow this recipe end to end: ${DEPLOY_WEBSITE_RECIPE_URL}`,
|
|
14255
|
+
"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.",
|
|
14256
|
+
FALLBACK_LINE
|
|
14257
|
+
].join("\n\n");
|
|
14258
|
+
function addDeployWebsiteTool(server, disableTools = [], toolDescriptions, fetchOptions = {}) {
|
|
14259
|
+
if (disableTools.includes(DEPLOY_WEBSITE_TOOL_NAME)) {
|
|
14260
|
+
return;
|
|
14261
|
+
}
|
|
14262
|
+
server.tool(
|
|
14263
|
+
DEPLOY_WEBSITE_TOOL_NAME,
|
|
14264
|
+
toolDescriptions?.[DEPLOY_WEBSITE_TOOL_NAME] ?? defaultToolDescriptions[DEPLOY_WEBSITE_TOOL_NAME],
|
|
14265
|
+
{},
|
|
14266
|
+
{ readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
14267
|
+
async (_args, { httpClient }) => {
|
|
14268
|
+
let text = DEPLOY_WEBSITE_POINTER_RESPONSE;
|
|
14269
|
+
try {
|
|
14270
|
+
const recipe = await fetchArticleContent(
|
|
14271
|
+
httpClient,
|
|
14272
|
+
DEPLOY_WEBSITE_RECIPE_URL.replace(/\.md$/, ""),
|
|
14273
|
+
"article",
|
|
14274
|
+
true,
|
|
14275
|
+
fetchOptions.skillsPortalUrl,
|
|
14276
|
+
fetchOptions.repo,
|
|
14277
|
+
fetchOptions.commitHash
|
|
14278
|
+
);
|
|
14279
|
+
if (recipe && recipe.trim()) {
|
|
14280
|
+
text = deployWebsiteResponse(recipe);
|
|
14281
|
+
}
|
|
14282
|
+
} catch (error) {
|
|
14283
|
+
console.warn(
|
|
14284
|
+
`[DeployWebsite] recipe fetch failed, returning the pointer:`,
|
|
14285
|
+
error instanceof Error ? error.message : error
|
|
14286
|
+
);
|
|
14287
|
+
}
|
|
14288
|
+
return { content: [{ type: "text", text }] };
|
|
14289
|
+
}
|
|
14290
|
+
);
|
|
14291
|
+
}
|
|
14292
|
+
|
|
14146
14293
|
// src/docs/docs.ts
|
|
14147
14294
|
var REST_SEARCH_API_GROUNDING_REMINDER = dedent_default`
|
|
14148
14295
|
# Before calling a Wix API
|
|
@@ -14191,6 +14338,7 @@ var addDocsTools = (server, allowedTools = [
|
|
|
14191
14338
|
const {
|
|
14192
14339
|
getToKnowWixEnabled = false,
|
|
14193
14340
|
createWixBusinessGuideEnabled = true,
|
|
14341
|
+
deployWebsiteEnabled = true,
|
|
14194
14342
|
disableTools,
|
|
14195
14343
|
toolDescriptions,
|
|
14196
14344
|
readmeDocs,
|
|
@@ -14256,6 +14404,13 @@ var addDocsTools = (server, allowedTools = [
|
|
|
14256
14404
|
cliEnabled
|
|
14257
14405
|
);
|
|
14258
14406
|
}
|
|
14407
|
+
if (deployWebsiteEnabled) {
|
|
14408
|
+
addDeployWebsiteTool(server, disableTools || [], toolDescriptions, {
|
|
14409
|
+
skillsPortalUrl,
|
|
14410
|
+
repo: effectiveRepo,
|
|
14411
|
+
commitHash: effectiveCommitHash
|
|
14412
|
+
});
|
|
14413
|
+
}
|
|
14259
14414
|
if (allowedTools.includes("WDS") && !disableTools?.includes("SearchWixWDSDocumentation")) {
|
|
14260
14415
|
server.tool(
|
|
14261
14416
|
"SearchWixWDSDocumentation",
|
|
@@ -14772,18 +14927,19 @@ var addDocsTools = (server, allowedTools = [
|
|
|
14772
14927
|
async ({ articleUrl }, { httpClient }) => {
|
|
14773
14928
|
const validPrefixes = ["https://dev.wix.com/docs/"];
|
|
14774
14929
|
if (skillsPortalUrl) validPrefixes.push(skillsPortalUrl);
|
|
14775
|
-
|
|
14930
|
+
const isSkillsPage = isSkillsRegistryUrl(articleUrl);
|
|
14931
|
+
if (!isSkillsPage && !validPrefixes.some((p) => articleUrl.startsWith(p))) {
|
|
14776
14932
|
return {
|
|
14777
14933
|
isError: true,
|
|
14778
14934
|
content: [
|
|
14779
14935
|
{
|
|
14780
14936
|
type: "text",
|
|
14781
|
-
text: `Invalid article URL: must start with https://dev.wix.com/docs
|
|
14937
|
+
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}"`
|
|
14782
14938
|
}
|
|
14783
14939
|
]
|
|
14784
14940
|
};
|
|
14785
14941
|
}
|
|
14786
|
-
if (articleUrl.startsWith("https://dev.wix.com/docs/")) {
|
|
14942
|
+
if (!isSkillsPage && articleUrl.startsWith("https://dev.wix.com/docs/")) {
|
|
14787
14943
|
articleUrl = articleUrl.replace(/\.md$/, "");
|
|
14788
14944
|
}
|
|
14789
14945
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.90",
|
|
4
4
|
"description": "A Model Context Protocol server for Wix AI tools",
|
|
5
5
|
"bin": "./build/bin-standalone.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
]
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
-
"falconPackageHash": "
|
|
136
|
+
"falconPackageHash": "d562cd11d61654cd119a10a3385e83892fd93dcb6ed41d7d119bc2e4"
|
|
137
137
|
}
|