@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/cjs/toolkit.cjs
CHANGED
|
@@ -17274,6 +17274,31 @@ async function fetchArticle(articleUrl) {
|
|
|
17274
17274
|
return fetchArticleContent(httpClient, articleUrl, "article", false);
|
|
17275
17275
|
}
|
|
17276
17276
|
var DOCS_URL_PREFIX = "https://dev.wix.com/docs/";
|
|
17277
|
+
var SKILLS_REGISTRY_URL = new RegExp(
|
|
17278
|
+
"^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)"
|
|
17279
|
+
);
|
|
17280
|
+
function isSkillsRegistryUrl(url) {
|
|
17281
|
+
return SKILLS_REGISTRY_URL.test(url.trim());
|
|
17282
|
+
}
|
|
17283
|
+
async function fetchSkillsRegistryPage(httpClient, url) {
|
|
17284
|
+
let data;
|
|
17285
|
+
try {
|
|
17286
|
+
({ data } = await httpClient.get(url, {
|
|
17287
|
+
headers: { accept: "text/markdown, text/plain;q=0.9, */*;q=0.1" }
|
|
17288
|
+
}));
|
|
17289
|
+
} catch (error) {
|
|
17290
|
+
const { message, status } = getHttpErrorDetails(error);
|
|
17291
|
+
const statusSuffix = status ? ` (status ${status})` : "";
|
|
17292
|
+
throw new Error(`${message}${statusSuffix}`);
|
|
17293
|
+
}
|
|
17294
|
+
if (typeof data !== "string") {
|
|
17295
|
+
return JSON.stringify(data, null, 2);
|
|
17296
|
+
}
|
|
17297
|
+
if (!data.trim()) {
|
|
17298
|
+
throw new Error("Article content is empty");
|
|
17299
|
+
}
|
|
17300
|
+
return data;
|
|
17301
|
+
}
|
|
17277
17302
|
function getResponseErrorMessage(data) {
|
|
17278
17303
|
if (!data) {
|
|
17279
17304
|
return void 0;
|
|
@@ -17364,13 +17389,15 @@ async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = f
|
|
|
17364
17389
|
`[fetch] Override failed for ${effectiveUrl}, falling back to ${articleUrl}:`,
|
|
17365
17390
|
error instanceof Error ? error.message : error
|
|
17366
17391
|
);
|
|
17367
|
-
content = await fetchArticleContentFromDigor(
|
|
17392
|
+
content = isSkillsRegistryUrl(articleUrl) ? await fetchSkillsRegistryPage(httpClient, articleUrl) : await fetchArticleContentFromDigor(
|
|
17368
17393
|
httpClient,
|
|
17369
17394
|
articleUrl,
|
|
17370
17395
|
mode,
|
|
17371
17396
|
stripHeader
|
|
17372
17397
|
);
|
|
17373
17398
|
}
|
|
17399
|
+
} else if (isSkillsRegistryUrl(articleUrl)) {
|
|
17400
|
+
content = await fetchSkillsRegistryPage(httpClient, articleUrl);
|
|
17374
17401
|
} else if (mode === "raw") {
|
|
17375
17402
|
let parsedUrl;
|
|
17376
17403
|
try {
|
|
@@ -17675,6 +17702,7 @@ function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance
|
|
|
17675
17702
|
"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.",
|
|
17676
17703
|
"**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.",
|
|
17677
17704
|
"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.",
|
|
17705
|
+
"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.",
|
|
17678
17706
|
"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."
|
|
17679
17707
|
);
|
|
17680
17708
|
}
|
|
@@ -17756,7 +17784,7 @@ var SITE_CREATION_COPY = {
|
|
|
17756
17784
|
var SITE_GUIDANCE = dedent_default`
|
|
17757
17785
|
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.
|
|
17758
17786
|
|
|
17759
|
-
One case skips all of this:
|
|
17787
|
+
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).
|
|
17760
17788
|
|
|
17761
17789
|
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.
|
|
17762
17790
|
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.
|
|
@@ -18014,6 +18042,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18014
18042
|
ReadFullDocsArticle: dedent_default`
|
|
18015
18043
|
Fetches the full Wix docs article or method article with code examples for using the method.
|
|
18016
18044
|
Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
|
|
18045
|
+
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.
|
|
18017
18046
|
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.
|
|
18018
18047
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
18019
18048
|
${reminder}
|
|
@@ -18021,7 +18050,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18021
18050
|
ReadFullDocsMethodSchema: dedent_default`
|
|
18022
18051
|
Fetches the full method schema for a given method.
|
|
18023
18052
|
This will give you the entire request/response schema with all the fields and their descriptions.
|
|
18024
|
-
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
|
|
18053
|
+
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.
|
|
18025
18054
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
18026
18055
|
${reminder}
|
|
18027
18056
|
`,
|
|
@@ -18147,7 +18176,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18147
18176
|
`,
|
|
18148
18177
|
"import-claude-design-from-url": dedent_default`
|
|
18149
18178
|
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.
|
|
18150
|
-
NOT for site
|
|
18179
|
+
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.
|
|
18151
18180
|
`,
|
|
18152
18181
|
RunWixCliCommand: dedent_default`
|
|
18153
18182
|
Executes Wix CLI commands for Wix app development and management.
|
|
@@ -18176,6 +18205,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18176
18205
|
`,
|
|
18177
18206
|
SearchWixSDKDocumentation: dedent_default`
|
|
18178
18207
|
Searches the Wix JavaScript SDK documentation.
|
|
18208
|
+
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.
|
|
18179
18209
|
`,
|
|
18180
18210
|
SearchBuildAppsDocumentation: dedent_default`
|
|
18181
18211
|
Searches the Wix Build Apps documentation.
|
|
@@ -18188,18 +18218,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18188
18218
|
SearchWixHeadlessDocumentation: dedent_default`
|
|
18189
18219
|
Searches the Wix Headless documentation.
|
|
18190
18220
|
`,
|
|
18191
|
-
// Note:
|
|
18192
|
-
//
|
|
18193
|
-
//
|
|
18194
|
-
//
|
|
18221
|
+
// Note: each method also carries its JavaScript SDK facet (`method.sdk`: package,
|
|
18222
|
+
// namespace, method name, positional signature, parameter schema, JS examples),
|
|
18223
|
+
// merged at spec-sync time from the docs' SDK view. REST fields are unchanged;
|
|
18224
|
+
// `sdk` is simply absent on methods the SDK docs don't list.
|
|
18195
18225
|
SearchWixAPISpec: dedent_default`
|
|
18196
|
-
Inspect the Wix REST API spec by writing JavaScript code that runs in a sandboxed read-only environment.
|
|
18197
|
-
**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.
|
|
18226
|
+
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.
|
|
18227
|
+
**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.
|
|
18198
18228
|
**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.
|
|
18199
|
-
**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.**
|
|
18229
|
+
**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.**
|
|
18200
18230
|
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]\`.
|
|
18201
18231
|
**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.
|
|
18202
|
-
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.
|
|
18232
|
+
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.
|
|
18203
18233
|
|
|
18204
18234
|
Prefer URL-first results:
|
|
18205
18235
|
- If you have a docs URL or partial docs URL, search \`resource.docsUrl\` and \`method.docsUrl\` first.
|
|
@@ -18207,7 +18237,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18207
18237
|
- For API execution, return and use \`method.publicUrl\` when available. It is the preferred executable \`https://www.wixapis.com/...\` URL.
|
|
18208
18238
|
- 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.
|
|
18209
18239
|
- Use \`resourceId\` only as the internal handle for low-level loaders; prefer URL helpers when you have a docs URL.
|
|
18210
|
-
- \`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
|
|
18240
|
+
- \`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\`.
|
|
18211
18241
|
|
|
18212
18242
|
Your code has access to these globals:
|
|
18213
18243
|
|
|
@@ -18222,6 +18252,8 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18222
18252
|
resourceId: string; // internal handle for getResourceSchema()
|
|
18223
18253
|
docsUrl: string; // e.g. "https://dev.wix.com/docs/api-reference/.../<resource>"
|
|
18224
18254
|
menuPath: string[]; // e.g. ["business-solutions", "<vertical>", "<resource>"]
|
|
18255
|
+
sdkPackage?: string; // JS SDK npm package shared by the resource's methods, e.g. "@wix/<vertical>"
|
|
18256
|
+
sdkNamespace?: string; // module exported by that package, e.g. "<resources>" — absent when the methods differ (then each method carries its own)
|
|
18225
18257
|
methods: Array<{
|
|
18226
18258
|
operationId: string; // e.g. "wix.<vertical>.v3.<Api>.<Operation>"
|
|
18227
18259
|
summary: string; // human-readable method name
|
|
@@ -18231,6 +18263,9 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18231
18263
|
publicUrl?: string; // preferred executable URL for ExecuteWixAPI, when available after spec sync
|
|
18232
18264
|
publicBaseUrl?: string;
|
|
18233
18265
|
description: string; // truncated to 200 chars
|
|
18266
|
+
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
|
|
18267
|
+
sdkPackage?: string; // only when the resource-level value is absent
|
|
18268
|
+
sdkNamespace?: string;
|
|
18234
18269
|
}>;
|
|
18235
18270
|
}
|
|
18236
18271
|
\`\`\`
|
|
@@ -18259,8 +18294,17 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18259
18294
|
legacyExamples: Array<{ // Curl examples
|
|
18260
18295
|
content: { title: string; request: string; response: string };
|
|
18261
18296
|
}>;
|
|
18297
|
+
sdk?: { // JavaScript SDK facet; absent when the SDK docs don't list the method
|
|
18298
|
+
package: string; // npm package, e.g. "@wix/<vertical>" → import { <namespace> } from "<package>"
|
|
18299
|
+
namespace: string; // module exported by the package, e.g. "<resources>"
|
|
18300
|
+
method: string; // SDK method name; NOT always the operation name (e.g. Data Items' InsertDataItem is "insert")
|
|
18301
|
+
signature: string[]; // positional parameter names in call order, e.g. ["query", "options"]
|
|
18302
|
+
requestBody: object | null; // same envelope as the REST requestBody; its properties ARE the parameters in \`signature\`, each typed
|
|
18303
|
+
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)
|
|
18304
|
+
examples: Array<{ title: string; description?: string; code: string }>; // JavaScript examples from the SDK docs
|
|
18305
|
+
};
|
|
18262
18306
|
}>;
|
|
18263
|
-
components: { schemas: object };
|
|
18307
|
+
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>")
|
|
18264
18308
|
}
|
|
18265
18309
|
\`\`\`
|
|
18266
18310
|
|
|
@@ -18322,6 +18366,16 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18322
18366
|
- 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.
|
|
18323
18367
|
- 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.
|
|
18324
18368
|
|
|
18369
|
+
JavaScript SDK (writing code with \`@wix/sdk\` and the \`@wix/*\` packages, in Wix Headless, Velo, CLI apps, or any Node/browser project):
|
|
18370
|
+
- 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.
|
|
18371
|
+
- 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.
|
|
18372
|
+
- 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.
|
|
18373
|
+
- 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.
|
|
18374
|
+
- 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"\`).
|
|
18375
|
+
- \`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.
|
|
18376
|
+
- 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.
|
|
18377
|
+
- 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.
|
|
18378
|
+
|
|
18325
18379
|
Examples:
|
|
18326
18380
|
|
|
18327
18381
|
Inspect one method schema by exact docs URL:
|
|
@@ -18366,6 +18420,39 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18366
18420
|
}
|
|
18367
18421
|
\`\`\`
|
|
18368
18422
|
|
|
18423
|
+
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\`):
|
|
18424
|
+
\`\`\`javascript
|
|
18425
|
+
async function() {
|
|
18426
|
+
const methodUrl = "https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products?apiView=SDK";
|
|
18427
|
+
|
|
18428
|
+
const schema = await getResourceSchemaByUrl(methodUrl);
|
|
18429
|
+
const method = schema.methods.find(method => method.docsUrl === methodUrl.replace(/\\?.*$/, ""));
|
|
18430
|
+
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 })) };
|
|
18431
|
+
if (!method.sdk) return { message: "The SDK docs do not list this method; use the REST call.", publicUrl: method.publicUrl, requestBody: method.requestBody };
|
|
18432
|
+
|
|
18433
|
+
const { sdk } = method;
|
|
18434
|
+
const types = schema.components.schemas;
|
|
18435
|
+
// Each positional parameter, typed. The parameters body is pre-expanded for a method URL;
|
|
18436
|
+
// any remaining { $circular: name } resolves against types[name].
|
|
18437
|
+
const paramsSchema = sdk.requestBody?.content?.["application/json"]?.schema ?? {};
|
|
18438
|
+
const parameters = sdk.signature.map(name => ({
|
|
18439
|
+
name,
|
|
18440
|
+
required: (paramsSchema.required ?? []).includes(name),
|
|
18441
|
+
schema: paramsSchema.properties?.[name]
|
|
18442
|
+
}));
|
|
18443
|
+
|
|
18444
|
+
return {
|
|
18445
|
+
import: \`import { \${sdk.namespace} } from "\${sdk.package}";\`,
|
|
18446
|
+
call: \`\${sdk.namespace}.\${sdk.method}(\${sdk.signature.join(", ")})\`,
|
|
18447
|
+
parameters,
|
|
18448
|
+
returns: sdk.responses ?? method.responses,
|
|
18449
|
+
// Query methods: the same closed list of filterable/sortable fields applies to the SDK call.
|
|
18450
|
+
queryFieldsCapabilities: method.queryMethodData?.queryFieldsCapabilitiesMap,
|
|
18451
|
+
example: sdk.examples[0]
|
|
18452
|
+
};
|
|
18453
|
+
}
|
|
18454
|
+
\`\`\`
|
|
18455
|
+
|
|
18369
18456
|
Inspect one resource by resource docs URL:
|
|
18370
18457
|
\`\`\`javascript
|
|
18371
18458
|
async function() {
|
|
@@ -18570,11 +18657,18 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
18570
18657
|
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.
|
|
18571
18658
|
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.
|
|
18572
18659
|
Set \`hasMutations: true\` for any document containing a mutation root field.
|
|
18660
|
+
`,
|
|
18661
|
+
DeployWebsite: dedent_default`
|
|
18662
|
+
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.
|
|
18663
|
+
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.
|
|
18664
|
+
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).
|
|
18665
|
+
Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
|
|
18666
|
+
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).
|
|
18573
18667
|
`,
|
|
18574
18668
|
CreateWixBusinessGuide: dedent_default`
|
|
18575
18669
|
Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
|
|
18576
18670
|
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\`.
|
|
18577
|
-
Exception, even when the user says "headless": if
|
|
18671
|
+
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.
|
|
18578
18672
|
|
|
18579
18673
|
## What This Tool Contains
|
|
18580
18674
|
|
|
@@ -19302,7 +19396,7 @@ var paramDescriptions = {
|
|
|
19302
19396
|
reason: "One sentence describing the original user request and the task you are trying to accomplish with this search."
|
|
19303
19397
|
},
|
|
19304
19398
|
ReadFullDocsArticle: {
|
|
19305
|
-
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)."
|
|
19399
|
+
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."
|
|
19306
19400
|
},
|
|
19307
19401
|
ReadFullDocsMethodSchema: {
|
|
19308
19402
|
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).",
|
|
@@ -19721,6 +19815,59 @@ ${articleContent}${nextSteps}`;
|
|
|
19721
19815
|
);
|
|
19722
19816
|
}
|
|
19723
19817
|
|
|
19818
|
+
// src/docs/deploy-website.ts
|
|
19819
|
+
var DEPLOY_WEBSITE_TOOL_NAME = "DeployWebsite";
|
|
19820
|
+
var DEPLOY_WEBSITE_RECIPE_URL = "https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md";
|
|
19821
|
+
var DROP_PAGE_URL = "https://www.wix.com/headless/drop?utm_campaign=mcp";
|
|
19822
|
+
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.`;
|
|
19823
|
+
function deployWebsiteResponse(recipe) {
|
|
19824
|
+
return [
|
|
19825
|
+
`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.`,
|
|
19826
|
+
FALLBACK_LINE,
|
|
19827
|
+
"---",
|
|
19828
|
+
recipe.trim()
|
|
19829
|
+
].join("\n\n");
|
|
19830
|
+
}
|
|
19831
|
+
var DEPLOY_WEBSITE_POINTER_RESPONSE = [
|
|
19832
|
+
`Read and follow this recipe end to end: ${DEPLOY_WEBSITE_RECIPE_URL}`,
|
|
19833
|
+
"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.",
|
|
19834
|
+
FALLBACK_LINE
|
|
19835
|
+
].join("\n\n");
|
|
19836
|
+
function addDeployWebsiteTool(server, disableTools = [], toolDescriptions, fetchOptions = {}) {
|
|
19837
|
+
if (disableTools.includes(DEPLOY_WEBSITE_TOOL_NAME)) {
|
|
19838
|
+
return;
|
|
19839
|
+
}
|
|
19840
|
+
server.tool(
|
|
19841
|
+
DEPLOY_WEBSITE_TOOL_NAME,
|
|
19842
|
+
toolDescriptions?.[DEPLOY_WEBSITE_TOOL_NAME] ?? defaultToolDescriptions[DEPLOY_WEBSITE_TOOL_NAME],
|
|
19843
|
+
{},
|
|
19844
|
+
{ readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
19845
|
+
async (_args, { httpClient }) => {
|
|
19846
|
+
let text = DEPLOY_WEBSITE_POINTER_RESPONSE;
|
|
19847
|
+
try {
|
|
19848
|
+
const recipe = await fetchArticleContent(
|
|
19849
|
+
httpClient,
|
|
19850
|
+
DEPLOY_WEBSITE_RECIPE_URL.replace(/\.md$/, ""),
|
|
19851
|
+
"article",
|
|
19852
|
+
true,
|
|
19853
|
+
fetchOptions.skillsPortalUrl,
|
|
19854
|
+
fetchOptions.repo,
|
|
19855
|
+
fetchOptions.commitHash
|
|
19856
|
+
);
|
|
19857
|
+
if (recipe && recipe.trim()) {
|
|
19858
|
+
text = deployWebsiteResponse(recipe);
|
|
19859
|
+
}
|
|
19860
|
+
} catch (error) {
|
|
19861
|
+
console.warn(
|
|
19862
|
+
`[DeployWebsite] recipe fetch failed, returning the pointer:`,
|
|
19863
|
+
error instanceof Error ? error.message : error
|
|
19864
|
+
);
|
|
19865
|
+
}
|
|
19866
|
+
return { content: [{ type: "text", text }] };
|
|
19867
|
+
}
|
|
19868
|
+
);
|
|
19869
|
+
}
|
|
19870
|
+
|
|
19724
19871
|
// src/docs/docs.ts
|
|
19725
19872
|
var REST_SEARCH_API_GROUNDING_REMINDER = dedent_default`
|
|
19726
19873
|
# Before calling a Wix API
|
|
@@ -19769,6 +19916,7 @@ var addDocsTools = (server, allowedTools = [
|
|
|
19769
19916
|
const {
|
|
19770
19917
|
getToKnowWixEnabled = false,
|
|
19771
19918
|
createWixBusinessGuideEnabled = true,
|
|
19919
|
+
deployWebsiteEnabled = true,
|
|
19772
19920
|
disableTools,
|
|
19773
19921
|
toolDescriptions,
|
|
19774
19922
|
readmeDocs,
|
|
@@ -19834,6 +19982,13 @@ var addDocsTools = (server, allowedTools = [
|
|
|
19834
19982
|
cliEnabled
|
|
19835
19983
|
);
|
|
19836
19984
|
}
|
|
19985
|
+
if (deployWebsiteEnabled) {
|
|
19986
|
+
addDeployWebsiteTool(server, disableTools || [], toolDescriptions, {
|
|
19987
|
+
skillsPortalUrl,
|
|
19988
|
+
repo: effectiveRepo,
|
|
19989
|
+
commitHash: effectiveCommitHash
|
|
19990
|
+
});
|
|
19991
|
+
}
|
|
19837
19992
|
if (allowedTools.includes("WDS") && !disableTools?.includes("SearchWixWDSDocumentation")) {
|
|
19838
19993
|
server.tool(
|
|
19839
19994
|
"SearchWixWDSDocumentation",
|
|
@@ -20350,18 +20505,19 @@ var addDocsTools = (server, allowedTools = [
|
|
|
20350
20505
|
async ({ articleUrl }, { httpClient }) => {
|
|
20351
20506
|
const validPrefixes = ["https://dev.wix.com/docs/"];
|
|
20352
20507
|
if (skillsPortalUrl) validPrefixes.push(skillsPortalUrl);
|
|
20353
|
-
|
|
20508
|
+
const isSkillsPage = isSkillsRegistryUrl(articleUrl);
|
|
20509
|
+
if (!isSkillsPage && !validPrefixes.some((p) => articleUrl.startsWith(p))) {
|
|
20354
20510
|
return {
|
|
20355
20511
|
isError: true,
|
|
20356
20512
|
content: [
|
|
20357
20513
|
{
|
|
20358
20514
|
type: "text",
|
|
20359
|
-
text: `Invalid article URL: must start with https://dev.wix.com/docs
|
|
20515
|
+
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}"`
|
|
20360
20516
|
}
|
|
20361
20517
|
]
|
|
20362
20518
|
};
|
|
20363
20519
|
}
|
|
20364
|
-
if (articleUrl.startsWith("https://dev.wix.com/docs/")) {
|
|
20520
|
+
if (!isSkillsPage && articleUrl.startsWith("https://dev.wix.com/docs/")) {
|
|
20365
20521
|
articleUrl = articleUrl.replace(/\.md$/, "");
|
|
20366
20522
|
}
|
|
20367
20523
|
try {
|
|
@@ -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.", "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.', '**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 DeployWebsite 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.");
|
|
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) {
|
|
@@ -80,7 +80,7 @@ export const SITE_CREATION_COPY = {
|
|
|
80
80
|
const SITE_GUIDANCE = dedent `
|
|
81
81
|
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.
|
|
82
82
|
|
|
83
|
-
One case skips all of this:
|
|
83
|
+
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).
|
|
84
84
|
|
|
85
85
|
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.
|
|
86
86
|
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.
|
|
@@ -338,6 +338,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
338
338
|
ReadFullDocsArticle: dedent `
|
|
339
339
|
Fetches the full Wix docs article or method article with code examples for using the method.
|
|
340
340
|
Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
|
|
341
|
+
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.
|
|
341
342
|
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.
|
|
342
343
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
343
344
|
${reminder}
|
|
@@ -345,7 +346,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
345
346
|
ReadFullDocsMethodSchema: dedent `
|
|
346
347
|
Fetches the full method schema for a given method.
|
|
347
348
|
This will give you the entire request/response schema with all the fields and their descriptions.
|
|
348
|
-
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
|
|
349
|
+
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.
|
|
349
350
|
For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
|
|
350
351
|
${reminder}
|
|
351
352
|
`,
|
|
@@ -471,7 +472,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
471
472
|
`,
|
|
472
473
|
'import-claude-design-from-url': dedent `
|
|
473
474
|
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.
|
|
474
|
-
NOT for site
|
|
475
|
+
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.
|
|
475
476
|
`,
|
|
476
477
|
RunWixCliCommand: dedent `
|
|
477
478
|
Executes Wix CLI commands for Wix app development and management.
|
|
@@ -500,6 +501,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
500
501
|
`,
|
|
501
502
|
SearchWixSDKDocumentation: dedent `
|
|
502
503
|
Searches the Wix JavaScript SDK documentation.
|
|
504
|
+
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.
|
|
503
505
|
`,
|
|
504
506
|
SearchBuildAppsDocumentation: dedent `
|
|
505
507
|
Searches the Wix Build Apps documentation.
|
|
@@ -512,18 +514,18 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
512
514
|
SearchWixHeadlessDocumentation: dedent `
|
|
513
515
|
Searches the Wix Headless documentation.
|
|
514
516
|
`,
|
|
515
|
-
// Note:
|
|
516
|
-
//
|
|
517
|
-
//
|
|
518
|
-
//
|
|
517
|
+
// Note: each method also carries its JavaScript SDK facet (`method.sdk`: package,
|
|
518
|
+
// namespace, method name, positional signature, parameter schema, JS examples),
|
|
519
|
+
// merged at spec-sync time from the docs' SDK view. REST fields are unchanged;
|
|
520
|
+
// `sdk` is simply absent on methods the SDK docs don't list.
|
|
519
521
|
SearchWixAPISpec: dedent `
|
|
520
|
-
Inspect the Wix REST API spec by writing JavaScript code that runs in a sandboxed read-only environment.
|
|
521
|
-
**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.
|
|
522
|
+
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.
|
|
523
|
+
**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.
|
|
522
524
|
**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.
|
|
523
|
-
**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.**
|
|
525
|
+
**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.**
|
|
524
526
|
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]\`.
|
|
525
527
|
**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.
|
|
526
|
-
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.
|
|
528
|
+
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.
|
|
527
529
|
|
|
528
530
|
Prefer URL-first results:
|
|
529
531
|
- If you have a docs URL or partial docs URL, search \`resource.docsUrl\` and \`method.docsUrl\` first.
|
|
@@ -531,7 +533,7 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
531
533
|
- For API execution, return and use \`method.publicUrl\` when available. It is the preferred executable \`https://www.wixapis.com/...\` URL.
|
|
532
534
|
- 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.
|
|
533
535
|
- Use \`resourceId\` only as the internal handle for low-level loaders; prefer URL helpers when you have a docs URL.
|
|
534
|
-
- \`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
|
|
536
|
+
- \`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\`.
|
|
535
537
|
|
|
536
538
|
Your code has access to these globals:
|
|
537
539
|
|
|
@@ -546,6 +548,8 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
546
548
|
resourceId: string; // internal handle for getResourceSchema()
|
|
547
549
|
docsUrl: string; // e.g. "https://dev.wix.com/docs/api-reference/.../<resource>"
|
|
548
550
|
menuPath: string[]; // e.g. ["business-solutions", "<vertical>", "<resource>"]
|
|
551
|
+
sdkPackage?: string; // JS SDK npm package shared by the resource's methods, e.g. "@wix/<vertical>"
|
|
552
|
+
sdkNamespace?: string; // module exported by that package, e.g. "<resources>" — absent when the methods differ (then each method carries its own)
|
|
549
553
|
methods: Array<{
|
|
550
554
|
operationId: string; // e.g. "wix.<vertical>.v3.<Api>.<Operation>"
|
|
551
555
|
summary: string; // human-readable method name
|
|
@@ -555,6 +559,9 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
555
559
|
publicUrl?: string; // preferred executable URL for ExecuteWixAPI, when available after spec sync
|
|
556
560
|
publicBaseUrl?: string;
|
|
557
561
|
description: string; // truncated to 200 chars
|
|
562
|
+
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
|
|
563
|
+
sdkPackage?: string; // only when the resource-level value is absent
|
|
564
|
+
sdkNamespace?: string;
|
|
558
565
|
}>;
|
|
559
566
|
}
|
|
560
567
|
\`\`\`
|
|
@@ -583,8 +590,17 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
583
590
|
legacyExamples: Array<{ // Curl examples
|
|
584
591
|
content: { title: string; request: string; response: string };
|
|
585
592
|
}>;
|
|
593
|
+
sdk?: { // JavaScript SDK facet; absent when the SDK docs don't list the method
|
|
594
|
+
package: string; // npm package, e.g. "@wix/<vertical>" → import { <namespace> } from "<package>"
|
|
595
|
+
namespace: string; // module exported by the package, e.g. "<resources>"
|
|
596
|
+
method: string; // SDK method name; NOT always the operation name (e.g. Data Items' InsertDataItem is "insert")
|
|
597
|
+
signature: string[]; // positional parameter names in call order, e.g. ["query", "options"]
|
|
598
|
+
requestBody: object | null; // same envelope as the REST requestBody; its properties ARE the parameters in \`signature\`, each typed
|
|
599
|
+
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)
|
|
600
|
+
examples: Array<{ title: string; description?: string; code: string }>; // JavaScript examples from the SDK docs
|
|
601
|
+
};
|
|
586
602
|
}>;
|
|
587
|
-
components: { schemas: object };
|
|
603
|
+
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>")
|
|
588
604
|
}
|
|
589
605
|
\`\`\`
|
|
590
606
|
|
|
@@ -646,6 +662,16 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
646
662
|
- 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.
|
|
647
663
|
- 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.
|
|
648
664
|
|
|
665
|
+
JavaScript SDK (writing code with \`@wix/sdk\` and the \`@wix/*\` packages, in Wix Headless, Velo, CLI apps, or any Node/browser project):
|
|
666
|
+
- 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.
|
|
667
|
+
- 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.
|
|
668
|
+
- 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.
|
|
669
|
+
- 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.
|
|
670
|
+
- 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"\`).
|
|
671
|
+
- \`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.
|
|
672
|
+
- 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.
|
|
673
|
+
- 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.
|
|
674
|
+
|
|
649
675
|
Examples:
|
|
650
676
|
|
|
651
677
|
Inspect one method schema by exact docs URL:
|
|
@@ -690,6 +716,39 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
690
716
|
}
|
|
691
717
|
\`\`\`
|
|
692
718
|
|
|
719
|
+
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\`):
|
|
720
|
+
\`\`\`javascript
|
|
721
|
+
async function() {
|
|
722
|
+
const methodUrl = "https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products?apiView=SDK";
|
|
723
|
+
|
|
724
|
+
const schema = await getResourceSchemaByUrl(methodUrl);
|
|
725
|
+
const method = schema.methods.find(method => method.docsUrl === methodUrl.replace(/\\?.*$/, ""));
|
|
726
|
+
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 })) };
|
|
727
|
+
if (!method.sdk) return { message: "The SDK docs do not list this method; use the REST call.", publicUrl: method.publicUrl, requestBody: method.requestBody };
|
|
728
|
+
|
|
729
|
+
const { sdk } = method;
|
|
730
|
+
const types = schema.components.schemas;
|
|
731
|
+
// Each positional parameter, typed. The parameters body is pre-expanded for a method URL;
|
|
732
|
+
// any remaining { $circular: name } resolves against types[name].
|
|
733
|
+
const paramsSchema = sdk.requestBody?.content?.["application/json"]?.schema ?? {};
|
|
734
|
+
const parameters = sdk.signature.map(name => ({
|
|
735
|
+
name,
|
|
736
|
+
required: (paramsSchema.required ?? []).includes(name),
|
|
737
|
+
schema: paramsSchema.properties?.[name]
|
|
738
|
+
}));
|
|
739
|
+
|
|
740
|
+
return {
|
|
741
|
+
import: \`import { \${sdk.namespace} } from "\${sdk.package}";\`,
|
|
742
|
+
call: \`\${sdk.namespace}.\${sdk.method}(\${sdk.signature.join(", ")})\`,
|
|
743
|
+
parameters,
|
|
744
|
+
returns: sdk.responses ?? method.responses,
|
|
745
|
+
// Query methods: the same closed list of filterable/sortable fields applies to the SDK call.
|
|
746
|
+
queryFieldsCapabilities: method.queryMethodData?.queryFieldsCapabilitiesMap,
|
|
747
|
+
example: sdk.examples[0]
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
\`\`\`
|
|
751
|
+
|
|
693
752
|
Inspect one resource by resource docs URL:
|
|
694
753
|
\`\`\`javascript
|
|
695
754
|
async function() {
|
|
@@ -894,11 +953,18 @@ export function buildToolDescriptions(includeReadme, includeImageUploadGuidance
|
|
|
894
953
|
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.
|
|
895
954
|
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.
|
|
896
955
|
Set \`hasMutations: true\` for any document containing a mutation root field.
|
|
956
|
+
`,
|
|
957
|
+
DeployWebsite: dedent `
|
|
958
|
+
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.
|
|
959
|
+
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.
|
|
960
|
+
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).
|
|
961
|
+
Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
|
|
962
|
+
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).
|
|
897
963
|
`,
|
|
898
964
|
CreateWixBusinessGuide: dedent `
|
|
899
965
|
Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
|
|
900
966
|
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\`.
|
|
901
|
-
Exception, even when the user says "headless": if
|
|
967
|
+
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.
|
|
902
968
|
|
|
903
969
|
## What This Tool Contains
|
|
904
970
|
|