@wix/mcp 1.0.11 → 1.0.13

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.
@@ -15206,7 +15206,6 @@ __export(index_exports, {
15206
15206
  addApiCallTool: () => addApiCallTool,
15207
15207
  addDocsResources: () => addDocsResources,
15208
15208
  addDocsTools: () => addDocsTools,
15209
- addGetToKnowTools: () => addGetToKnowTools,
15210
15209
  addSupportTool: () => addSupportTool,
15211
15210
  handleWixAPIResponse: () => handleWixAPIResponse
15212
15211
  });
@@ -23643,6 +23642,61 @@ async function fetchArticleContent(httpClient, articleUrl, mode) {
23643
23642
  return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
23644
23643
  }
23645
23644
 
23645
+ // src/docs/get-to-know.ts
23646
+ var docURLs = [
23647
+ {
23648
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions"
23649
+ },
23650
+ {
23651
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts"
23652
+ },
23653
+ {
23654
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions"
23655
+ },
23656
+ {
23657
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes"
23658
+ }
23659
+ ];
23660
+ var DESCRIPTION = `**Tool Name:** WixREADME
23661
+ **Description for LLM:**
23662
+ "**Mandatory First Action for Wix Tasks.** This tool, 'WixREADME', MUST be executed at the very beginning of any process involving Wix functionalities. It provides the indispensable foundational Wix ecosystem context, global setup details, and current best practices.
23663
+
23664
+ **Operational Rule:** Your processing protocol for any Wix-related task dictates that 'WixREADME' is successfully invoked and its output comprehensively analyzed BEFORE any other Wix-specific tool (such as 'ReadFullDocsArticle' or 'SearchX..') is considered or used. This is a non-negotiable prerequisite.
23665
+
23666
+ **Function:** Acts as the sole authoritative source for Wix global operational standards and session initialization. Its output is essential for the correct and safe execution of all subsequent Wix-related actions. All other Wix tools are designed to rely on the information it provides."
23667
+
23668
+ **Next Steps:** After executing 'WixREADME', relevant information from the README may include links to other documents. You MUST use the 'ReadFullDocsArticle' tool to fetch the full content of these documents. This is a critical step to ensure you have all necessary information before proceeding with any other Wix tools.
23669
+ `;
23670
+ var WixREADME_DEPENDENT_DESCRIPTION = `**Dependency:** Must be used after 'WixREADME' has successfully run.`;
23671
+ async function addGetToKnowTools(server) {
23672
+ server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
23673
+ try {
23674
+ const contents = await Promise.all(
23675
+ docURLs.map(async ({ url }) => {
23676
+ const content = await fetchArticleContent(httpClient, url, "article");
23677
+ return content;
23678
+ })
23679
+ );
23680
+ return {
23681
+ content: contents.map((content) => ({
23682
+ type: "text",
23683
+ text: content
23684
+ }))
23685
+ };
23686
+ } catch (error) {
23687
+ return {
23688
+ isError: true,
23689
+ content: [
23690
+ {
23691
+ type: "text",
23692
+ text: `Error fetching the document: ${error.message}`
23693
+ }
23694
+ ]
23695
+ };
23696
+ }
23697
+ });
23698
+ }
23699
+
23646
23700
  // src/docs/docs.ts
23647
23701
  var VALID_DOCS_TOOLS = [
23648
23702
  "WDS",
@@ -23659,7 +23713,10 @@ var addDocsTools = (server, allowedTools = [
23659
23713
  "BUILD_APPS",
23660
23714
  "WIX_HEADLESS",
23661
23715
  "BUSINESS_SOLUTIONS"
23662
- ]) => {
23716
+ ], getToKnowWixEnabled = false) => {
23717
+ if (getToKnowWixEnabled) {
23718
+ addGetToKnowTools(server);
23719
+ }
23663
23720
  if (allowedTools.includes("WDS")) {
23664
23721
  server.tool(
23665
23722
  "SearchWixWDSDocumentation",
@@ -23667,7 +23724,8 @@ var addDocsTools = (server, allowedTools = [
23667
23724
  "Searches the Wix Design System Documentation for components and patterns.",
23668
23725
  "Use this tool when you need to understand or implement UI components and design patterns in a Wix project.",
23669
23726
  "Search for specific component names, patterns, or UI requirements.",
23670
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23727
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23728
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23671
23729
  ].join("\n"),
23672
23730
  {
23673
23731
  searchTerm: z.string().describe(
@@ -23721,7 +23779,8 @@ var addDocsTools = (server, allowedTools = [
23721
23779
  "Searches the official Wix REST API documentation.",
23722
23780
  "Use this tool whenever you need to to interact with the Wix platform via HTTP requests.",
23723
23781
  "Specify the API endpoint, resource, or action you need information about (e.g., 'get site details endpoint', 'create data collection', 'update product API', 'REST authentication').",
23724
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23782
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23783
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23725
23784
  ].join("\n"),
23726
23785
  {
23727
23786
  searchTerm: z.string().describe(
@@ -23773,7 +23832,7 @@ var addDocsTools = (server, allowedTools = [
23773
23832
  }
23774
23833
  );
23775
23834
  }
23776
- if (allowedTools.includes("BUSINESS_SOLUTIONS")) {
23835
+ if (allowedTools.includes("BUSINESS_SOLUTIONS") && !getToKnowWixEnabled) {
23777
23836
  server.tool(
23778
23837
  "WixBusinessFlowsDocumentation",
23779
23838
  [
@@ -23842,7 +23901,8 @@ var addDocsTools = (server, allowedTools = [
23842
23901
  "Searches the official Wix javascript SDK documentation.",
23843
23902
  "Use this tool whenever you need to write or modify Wix related SDK code.",
23844
23903
  "Specify the SDK module, function, or feature you need information about (e.g., 'how to query all items from a data collection?', 'how to use wix-stores-backend', 'authentication methods in the SDK').",
23845
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23904
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23905
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23846
23906
  ].join("\n"),
23847
23907
  {
23848
23908
  searchTerm: z.string().describe(
@@ -23903,7 +23963,8 @@ var addDocsTools = (server, allowedTools = [
23903
23963
  "Searches the official Build Apps documentation.",
23904
23964
  "Use this tool when you need to understand or implement Wix CLI applications related code.",
23905
23965
  "The search term should be a specific Wix CLI command or specific topic related to Wix CLI applications or its ecosystem (e.g. deployment, creating new extensions etc).",
23906
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23966
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23967
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23907
23968
  ].join("\n"),
23908
23969
  {
23909
23970
  searchTerm: z.string().describe(
@@ -23956,7 +24017,8 @@ var addDocsTools = (server, allowedTools = [
23956
24017
  "Searches the official Wix Headless Documentation.",
23957
24018
  "Use this tool when you need to understand or implement Headless related code.",
23958
24019
  "The search term should be a specific Wix Headless topic or feature you need information about.",
23959
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
24020
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
24021
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23960
24022
  ].join("\n"),
23961
24023
  {
23962
24024
  searchTerm: z.string().describe(
@@ -24006,7 +24068,8 @@ var addDocsTools = (server, allowedTools = [
24006
24068
  "ReadFullDocsArticle",
24007
24069
  [
24008
24070
  "Fetches the full Wix docs article or method article.",
24009
- "Use this tool when you read a summary of a docs article or method article, you have the docs url and want to read the full article."
24071
+ "Use this tool when you read a summary of a docs article or method article, you have the docs url and want to read the full article.",
24072
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
24010
24073
  ].join("\n"),
24011
24074
  {
24012
24075
  articleUrl: z.string().describe(
@@ -24099,41 +24162,6 @@ var addDocsTools = (server, allowedTools = [
24099
24162
  );
24100
24163
  };
24101
24164
 
24102
- // src/docs/get-to-know.ts
24103
- var defaultDocUrl = "https://dev.wix.com/docs/picasso/wix-ai-docs/rules/get-to-know-wix-llm-instructions";
24104
- var DESCRIPTION = `**Tool Name:** WixREADME
24105
- **Description for LLM:**
24106
- "**Mandatory First Action for Wix Tasks.** This tool, 'WixREADME', MUST be executed at the very beginning of any process involving Wix functionalities. It provides the indispensable foundational Wix ecosystem context, global setup details, and current best practices.
24107
-
24108
- **Operational Rule:** Your processing protocol for any Wix-related task dictates that 'WixREADME' is successfully invoked and its output comprehensively analyzed BEFORE any other Wix-specific tool (such as 'ReadFullDocsArticle' or 'SearchX..') is considered or used. This is a non-negotiable prerequisite.
24109
-
24110
- **Function:** Acts as the sole authoritative source for Wix global operational standards and session initialization. Its output is essential for the correct and safe execution of all subsequent Wix-related actions. All other Wix tools are designed to rely on the information it provides."`;
24111
- async function addGetToKnowTools(server, docUrl) {
24112
- server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
24113
- try {
24114
- const doc = docUrl ? await fetchArticleContent(httpClient, docUrl, "raw") : await fetchArticleContent(httpClient, defaultDocUrl, "article");
24115
- return {
24116
- content: [
24117
- {
24118
- type: "text",
24119
- text: doc
24120
- }
24121
- ]
24122
- };
24123
- } catch (error) {
24124
- return {
24125
- isError: true,
24126
- content: [
24127
- {
24128
- type: "text",
24129
- text: `Error fetching the document: ${error.message}`
24130
- }
24131
- ]
24132
- };
24133
- }
24134
- });
24135
- }
24136
-
24137
24165
  // src/tool-utils.ts
24138
24166
  var safeParseJSON = (text) => {
24139
24167
  try {
@@ -24158,7 +24186,7 @@ var buildErrorMessage = ({
24158
24186
  ].filter((str) => !!str).join("\n");
24159
24187
  };
24160
24188
  var handleWixAPIResponse = async (response) => {
24161
- const requestId = response.headers.get("x-wix-request-id");
24189
+ const requestId = response.headers.get?.("x-wix-request-id");
24162
24190
  if (!response.status.toString().startsWith("2")) {
24163
24191
  const errorMessage = buildErrorMessage({
24164
24192
  status: response.status,
@@ -24420,7 +24448,6 @@ function addSupportTool(server) {
24420
24448
  addApiCallTool,
24421
24449
  addDocsResources,
24422
24450
  addDocsTools,
24423
- addGetToKnowTools,
24424
24451
  addSupportTool,
24425
24452
  handleWixAPIResponse
24426
24453
  });