@wix/mcp 1.0.79 → 1.0.80
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 +22 -8
- package/build/cjs/index.cjs +362 -101
- package/build/cjs/toolkit.cjs +31 -14
- package/build/dts/account-tools/get-profile-tool.d.ts +5 -0
- package/build/dts/account-tools/get-profile-tool.js +49 -0
- package/build/dts/config/default-config.d.ts +2 -2
- package/build/dts/config/default-config.js +11 -7
- package/build/dts/index.d.ts +1 -0
- package/build/dts/index.js +1 -0
- package/build/dts/toolkit-entry.d.cts +2 -0
- package/build/dts/toolkit-entry.d.ts +2 -0
- package/build/dts/toolkit.d.ts +2 -0
- package/build/dts/toolkit.js +14 -20
- package/build/esm/index.js +277 -43
- package/build/esm/toolkit.js +31 -14
- package/package.json +3 -2
package/build/cjs/toolkit.cjs
CHANGED
|
@@ -17658,7 +17658,7 @@ var DISCOVERY_FLOWS = [
|
|
|
17658
17658
|
"- METHOD CODE EXAMPLE BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() to get method code examples -> call API using CallWixSiteAPI() based on the method code examples",
|
|
17659
17659
|
"- FULL SCHEMA BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() -> no method code examples found -> inspect the method schema using SearchWixAPISpec or ReadFullDocsMethodSchema -> call API using CallWixSiteAPI() based on the schema"
|
|
17660
17660
|
];
|
|
17661
|
-
function buildSystemReminderGuidelines(includeReadme) {
|
|
17661
|
+
function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance) {
|
|
17662
17662
|
const exception = includeReadme ? "**Exception:** " : "";
|
|
17663
17663
|
const lines = [];
|
|
17664
17664
|
if (includeReadme) {
|
|
@@ -17670,9 +17670,13 @@ function buildSystemReminderGuidelines(includeReadme) {
|
|
|
17670
17670
|
);
|
|
17671
17671
|
}
|
|
17672
17672
|
lines.push(
|
|
17673
|
-
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly
|
|
17674
|
-
`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? "WixREADME and " : ""}all docs/schema/API flows \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
17673
|
+
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly.`
|
|
17675
17674
|
);
|
|
17675
|
+
if (includeImageUploadGuidance) {
|
|
17676
|
+
lines.push(
|
|
17677
|
+
`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? "WixREADME and " : ""}all docs/schema/API flows \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
17678
|
+
);
|
|
17679
|
+
}
|
|
17676
17680
|
if (includeReadme) {
|
|
17677
17681
|
lines.push(
|
|
17678
17682
|
"If the WixREADME tool is not available to you, you should use the other flows as described without using the WixREADME tool until the task is completed."
|
|
@@ -17699,9 +17703,15 @@ function buildSystemReminderFlows(includeReadme) {
|
|
|
17699
17703
|
lines.push(...DISCOVERY_FLOWS);
|
|
17700
17704
|
return lines.join("\n");
|
|
17701
17705
|
}
|
|
17702
|
-
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
17703
|
-
|
|
17704
|
-
|
|
17706
|
+
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
17707
|
+
true,
|
|
17708
|
+
true
|
|
17709
|
+
);
|
|
17710
|
+
function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
|
|
17711
|
+
const guidelines = buildSystemReminderGuidelines(
|
|
17712
|
+
includeReadme,
|
|
17713
|
+
includeImageUploadGuidance
|
|
17714
|
+
);
|
|
17705
17715
|
const flows = buildSystemReminderFlows(includeReadme);
|
|
17706
17716
|
return dedent_default`
|
|
17707
17717
|
<agent-mandatory-instructions>
|
|
@@ -17912,8 +17922,11 @@ var executeWixApiDescription = dedent_default`
|
|
|
17912
17922
|
|
|
17913
17923
|
${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}
|
|
17914
17924
|
`;
|
|
17915
|
-
function buildToolDescriptions(includeReadme) {
|
|
17916
|
-
const reminder = buildSystemReminder(
|
|
17925
|
+
function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true) {
|
|
17926
|
+
const reminder = buildSystemReminder(
|
|
17927
|
+
includeReadme,
|
|
17928
|
+
includeImageUploadGuidance
|
|
17929
|
+
);
|
|
17917
17930
|
return {
|
|
17918
17931
|
WixREADME: dedent_default`
|
|
17919
17932
|
# Tool: WixREADME
|
|
@@ -17964,6 +17977,7 @@ function buildToolDescriptions(includeReadme) {
|
|
|
17964
17977
|
**Prefer this tool over CallWixSiteAPI for listing sites.** Call this tool directly — it already knows the correct API and handles everything needed. Only fall back to CallWixSiteAPI if the user needs advanced filtering or specific site details beyond what this tool provides.
|
|
17965
17978
|
${reminder}
|
|
17966
17979
|
`,
|
|
17980
|
+
get_profile: "Returns the authenticated user's email address",
|
|
17967
17981
|
GetSiteContext: dedent_default`
|
|
17968
17982
|
Fetches deep context for a specific Wix site and returns it as structured markdown.
|
|
17969
17983
|
|
|
@@ -21607,13 +21621,13 @@ function createWixToolkit(options) {
|
|
|
21607
21621
|
clientName,
|
|
21608
21622
|
hooks,
|
|
21609
21623
|
conversationId,
|
|
21610
|
-
includeReadmeMentions = false
|
|
21624
|
+
includeReadmeMentions = false,
|
|
21625
|
+
includeImageUploadGuidance = false
|
|
21611
21626
|
} = options;
|
|
21612
21627
|
const authStrategy = normalizeAuth(auth);
|
|
21613
21628
|
const executeWixApiRequested = isExecuteWixApiRequested(api);
|
|
21614
|
-
|
|
21629
|
+
const descriptionsWithoutReadme = buildToolDescriptions(includeReadmeMentions, includeImageUploadGuidance);
|
|
21615
21630
|
if (!includeReadmeMentions) {
|
|
21616
|
-
descriptionsWithoutReadme = buildToolDescriptions(false);
|
|
21617
21631
|
delete descriptionsWithoutReadme.WixREADME;
|
|
21618
21632
|
}
|
|
21619
21633
|
const sessionId = v4_default();
|
|
@@ -21630,13 +21644,16 @@ function createWixToolkit(options) {
|
|
|
21630
21644
|
authStrategy,
|
|
21631
21645
|
dynamicContextEnabled: true,
|
|
21632
21646
|
// README-free defaults first so consumer overrides still win.
|
|
21633
|
-
toolDescriptions:
|
|
21647
|
+
toolDescriptions: {
|
|
21648
|
+
...descriptionsWithoutReadme,
|
|
21649
|
+
...docsOptions.toolDescriptions
|
|
21650
|
+
}
|
|
21634
21651
|
});
|
|
21635
21652
|
} else {
|
|
21636
21653
|
addDocsTools(server, void 0, {
|
|
21637
21654
|
authStrategy,
|
|
21638
21655
|
dynamicContextEnabled: true,
|
|
21639
|
-
|
|
21656
|
+
toolDescriptions: descriptionsWithoutReadme
|
|
21640
21657
|
});
|
|
21641
21658
|
}
|
|
21642
21659
|
if (api) {
|
|
@@ -21649,7 +21666,7 @@ function createWixToolkit(options) {
|
|
|
21649
21666
|
maxResponseSize,
|
|
21650
21667
|
codeModeBaseUrl = "https://mcp.wix.com"
|
|
21651
21668
|
} = api;
|
|
21652
|
-
const effectiveToolDescriptions =
|
|
21669
|
+
const effectiveToolDescriptions = {
|
|
21653
21670
|
...descriptionsWithoutReadme,
|
|
21654
21671
|
...executeWixApiRequested ? executeCodeModeToolDescriptions : {},
|
|
21655
21672
|
...toolDescriptions
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type McpAuthenticationStrategy } from '../auth/index.js';
|
|
2
|
+
import type { WixMcpServer } from '../wix-mcp-server.js';
|
|
3
|
+
import type { ToolHintsConfig } from '../api-call/index.js';
|
|
4
|
+
export declare function addGetProfileTool(server: WixMcpServer, authStrategy: McpAuthenticationStrategy, disableTools?: string[], toolDescriptions?: Record<string, string>, toolHints?: Record<string, ToolHintsConfig>): void;
|
|
5
|
+
//# sourceMappingURL=get-profile-tool.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { rethrowIfUnauthorized } from '../auth/index.js';
|
|
2
|
+
import { defaultToolDescriptions } from '../config/default-config.js';
|
|
3
|
+
import { createHttpClient } from '@wix/http-client';
|
|
4
|
+
import { getTeamMember } from '@wix/ambassador-identity-account-v1-user/http';
|
|
5
|
+
const WIX_APIS_BASE_URL = 'https://www.wixapis.com';
|
|
6
|
+
const GET_PROFILE_TOOL_NAME = 'get_profile';
|
|
7
|
+
export function addGetProfileTool(server, authStrategy, disableTools = [], toolDescriptions, toolHints) {
|
|
8
|
+
if (disableTools.includes(GET_PROFILE_TOOL_NAME)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const cache = {};
|
|
12
|
+
const hints = toolHints?.[GET_PROFILE_TOOL_NAME];
|
|
13
|
+
server.tool(GET_PROFILE_TOOL_NAME, toolDescriptions?.[GET_PROFILE_TOOL_NAME] ??
|
|
14
|
+
defaultToolDescriptions[GET_PROFILE_TOOL_NAME], {}, {
|
|
15
|
+
readOnlyHint: hints?.readOnlyHint ?? true,
|
|
16
|
+
destructiveHint: hints?.destructiveHint ?? false,
|
|
17
|
+
openWorldHint: hints?.openWorldHint ?? false
|
|
18
|
+
}, async () => {
|
|
19
|
+
const profilePromise = (cache.profilePromise ??= (async () => {
|
|
20
|
+
const accountAuthHeaders = await authStrategy.getAccountAuthHeaders();
|
|
21
|
+
const httpClient = createHttpClient({
|
|
22
|
+
baseURL: WIX_APIS_BASE_URL,
|
|
23
|
+
headers: accountAuthHeaders
|
|
24
|
+
});
|
|
25
|
+
const response = await httpClient.request(getTeamMember({}));
|
|
26
|
+
const email = response.data.user?.email;
|
|
27
|
+
if (!email) {
|
|
28
|
+
throw new Error('The current Wix user profile has no email address.');
|
|
29
|
+
}
|
|
30
|
+
return { email };
|
|
31
|
+
})());
|
|
32
|
+
const profile = await profilePromise.catch(async (error) => {
|
|
33
|
+
cache.profilePromise = undefined;
|
|
34
|
+
rethrowIfUnauthorized(error);
|
|
35
|
+
await authStrategy.enforceValidWixToken?.(error);
|
|
36
|
+
throw error;
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text',
|
|
42
|
+
text: profile.email
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
structuredContent: profile
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=get-profile-tool.js.map
|
|
@@ -21,7 +21,7 @@ export interface ModeDefaultConfig {
|
|
|
21
21
|
skillsPrOverrideEnabled?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const SYSTEM_REMINDER_GUIDELINES: string;
|
|
24
|
-
export declare function buildSystemReminder(includeReadme: boolean): string;
|
|
24
|
+
export declare function buildSystemReminder(includeReadme: boolean, includeImageUploadGuidance?: boolean): string;
|
|
25
25
|
export declare const SYSTEM_REMINDER: string;
|
|
26
26
|
export declare const SITE_CREATION_COPY: {
|
|
27
27
|
readonly templatePick: {
|
|
@@ -40,7 +40,7 @@ export declare const SITE_CREATION_COPY: {
|
|
|
40
40
|
/** Rewrites non-widget copy into its widget form; a no-op on text that carries no divergence. */
|
|
41
41
|
export declare const toWidget: (text: string) => string;
|
|
42
42
|
export declare const executeWixApiDescription: string;
|
|
43
|
-
export declare function buildToolDescriptions(includeReadme: boolean): Record<string, string>;
|
|
43
|
+
export declare function buildToolDescriptions(includeReadme: boolean, includeImageUploadGuidance?: boolean): Record<string, string>;
|
|
44
44
|
/**
|
|
45
45
|
* Canonical (README-inclusive) tool descriptions used by the live MCP server and
|
|
46
46
|
* all existing importers.
|
|
@@ -13,13 +13,16 @@ const DISCOVERY_FLOWS = [
|
|
|
13
13
|
];
|
|
14
14
|
// README-only lines and site-creation routing are added only when includeReadme
|
|
15
15
|
// is true (README-free consumers like aria don't do site creation).
|
|
16
|
-
function buildSystemReminderGuidelines(includeReadme) {
|
|
16
|
+
function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance) {
|
|
17
17
|
const exception = includeReadme ? '**Exception:** ' : '';
|
|
18
18
|
const lines = [];
|
|
19
19
|
if (includeReadme) {
|
|
20
20
|
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
21
|
}
|
|
22
|
-
lines.push(`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly
|
|
22
|
+
lines.push(`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? 'skip WixREADME and ' : ''}call ListWixSites directly.`);
|
|
23
|
+
if (includeImageUploadGuidance) {
|
|
24
|
+
lines.push(`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? 'WixREADME and ' : ''}all docs/schema/API flows — call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`);
|
|
25
|
+
}
|
|
23
26
|
if (includeReadme) {
|
|
24
27
|
lines.push('If the WixREADME tool is not available to you, you should use the other flows as described without using the WixREADME tool until the task is completed.');
|
|
25
28
|
}
|
|
@@ -34,9 +37,9 @@ function buildSystemReminderFlows(includeReadme) {
|
|
|
34
37
|
lines.push(...DISCOVERY_FLOWS);
|
|
35
38
|
return lines.join('\n');
|
|
36
39
|
}
|
|
37
|
-
export const SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(true);
|
|
38
|
-
export function buildSystemReminder(includeReadme) {
|
|
39
|
-
const guidelines = buildSystemReminderGuidelines(includeReadme);
|
|
40
|
+
export const SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(true, true);
|
|
41
|
+
export function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
|
|
42
|
+
const guidelines = buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance);
|
|
40
43
|
const flows = buildSystemReminderFlows(includeReadme);
|
|
41
44
|
return dedent `
|
|
42
45
|
<agent-mandatory-instructions>
|
|
@@ -254,8 +257,8 @@ export const executeWixApiDescription = dedent `
|
|
|
254
257
|
|
|
255
258
|
${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}
|
|
256
259
|
`;
|
|
257
|
-
export function buildToolDescriptions(includeReadme) {
|
|
258
|
-
const reminder = buildSystemReminder(includeReadme);
|
|
260
|
+
export function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true) {
|
|
261
|
+
const reminder = buildSystemReminder(includeReadme, includeImageUploadGuidance);
|
|
259
262
|
return {
|
|
260
263
|
WixREADME: dedent `
|
|
261
264
|
# Tool: WixREADME
|
|
@@ -306,6 +309,7 @@ export function buildToolDescriptions(includeReadme) {
|
|
|
306
309
|
**Prefer this tool over CallWixSiteAPI for listing sites.** Call this tool directly — it already knows the correct API and handles everything needed. Only fall back to CallWixSiteAPI if the user needs advanced filtering or specific site details beyond what this tool provides.
|
|
307
310
|
${reminder}
|
|
308
311
|
`,
|
|
312
|
+
get_profile: "Returns the authenticated user's email address",
|
|
309
313
|
GetSiteContext: dedent `
|
|
310
314
|
Fetches deep context for a specific Wix site and returns it as structured markdown.
|
|
311
315
|
|
package/build/dts/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { addApiCallTool, ToolHintsConfig } from './api-call/index.js';
|
|
|
5
5
|
export { handleWixAPIResponse } from './tool-utils.js';
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
|
+
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
8
9
|
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool, type SiteWidgetToolOptions } from './site-widget-tools/index.js';
|
|
9
10
|
export * from './wixel/index.js';
|
|
10
11
|
export { addImportClaudeDesignTool, type ImportClaudeDesignToolOptions } from './import-claude-design-tool/index.js';
|
package/build/dts/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { addApiCallTool } from './api-call/index.js';
|
|
|
5
5
|
export { handleWixAPIResponse } from './tool-utils.js';
|
|
6
6
|
export { addDocsResources } from './resources/docs.js';
|
|
7
7
|
export { addSupportTool } from './support/index.js';
|
|
8
|
+
export { addGetProfileTool } from './account-tools/get-profile-tool.js';
|
|
8
9
|
export { addCreateSiteWidgetTool, addEditSiteWidgetTool, addPullSiteJobTool, addClaimSiteTool, addSiteCreationWidgetTools, addWixSiteCreationTool, addSearchSiteTemplatesTool, addCreateSiteFromTemplateTool } from './site-widget-tools/index.js';
|
|
9
10
|
export * from './wixel/index.js';
|
|
10
11
|
export { addImportClaudeDesignTool } from './import-claude-design-tool/index.js';
|
|
@@ -289,6 +289,8 @@ export interface WixToolkitOptions {
|
|
|
289
289
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
290
290
|
*/
|
|
291
291
|
includeReadmeMentions?: boolean;
|
|
292
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
293
|
+
includeImageUploadGuidance?: boolean;
|
|
292
294
|
}
|
|
293
295
|
/**
|
|
294
296
|
* Create a WixToolkit that provides pre-wired tool objects for in-process use.
|
|
@@ -289,6 +289,8 @@ export interface WixToolkitOptions {
|
|
|
289
289
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
290
290
|
*/
|
|
291
291
|
includeReadmeMentions?: boolean;
|
|
292
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
293
|
+
includeImageUploadGuidance?: boolean;
|
|
292
294
|
}
|
|
293
295
|
/**
|
|
294
296
|
* Create a WixToolkit that provides pre-wired tool objects for in-process use.
|
package/build/dts/toolkit.d.ts
CHANGED
|
@@ -151,6 +151,8 @@ export interface WixToolkitOptions {
|
|
|
151
151
|
* MCP server's text. Only affects description text — never the tool set itself.
|
|
152
152
|
*/
|
|
153
153
|
includeReadmeMentions?: boolean;
|
|
154
|
+
/** Keep image-upload routing guidance in tool descriptions. Defaults to `false`. */
|
|
155
|
+
includeImageUploadGuidance?: boolean;
|
|
154
156
|
}
|
|
155
157
|
export { extractText, formatToolResultAdditionalFields };
|
|
156
158
|
/**
|
package/build/dts/toolkit.js
CHANGED
|
@@ -148,14 +148,13 @@ export { extractText, formatToolResultAdditionalFields };
|
|
|
148
148
|
* schema manipulation (defaults) internally.
|
|
149
149
|
*/
|
|
150
150
|
export function createWixToolkit(options) {
|
|
151
|
-
const { auth, docs, api, defaults = {}, exclude = [], clientName, hooks, conversationId, includeReadmeMentions = false } = options;
|
|
151
|
+
const { auth, docs, api, defaults = {}, exclude = [], clientName, hooks, conversationId, includeReadmeMentions = false, includeImageUploadGuidance = false } = options;
|
|
152
152
|
const authStrategy = normalizeAuth(auth);
|
|
153
153
|
const executeWixApiRequested = isExecuteWixApiRequested(api);
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
|
|
154
|
+
// Apply both description flags consistently. WixREADME is left out when
|
|
155
|
+
// mentions are disabled so its own description keeps its default text.
|
|
156
|
+
const descriptionsWithoutReadme = buildToolDescriptions(includeReadmeMentions, includeImageUploadGuidance);
|
|
157
157
|
if (!includeReadmeMentions) {
|
|
158
|
-
descriptionsWithoutReadme = buildToolDescriptions(false);
|
|
159
158
|
delete descriptionsWithoutReadme.WixREADME;
|
|
160
159
|
}
|
|
161
160
|
const sessionId = uuidv4();
|
|
@@ -177,9 +176,10 @@ export function createWixToolkit(options) {
|
|
|
177
176
|
authStrategy,
|
|
178
177
|
dynamicContextEnabled: true,
|
|
179
178
|
// README-free defaults first so consumer overrides still win.
|
|
180
|
-
toolDescriptions:
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
toolDescriptions: {
|
|
180
|
+
...descriptionsWithoutReadme,
|
|
181
|
+
...docsOptions.toolDescriptions
|
|
182
|
+
}
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
@@ -187,24 +187,18 @@ export function createWixToolkit(options) {
|
|
|
187
187
|
addDocsTools(server, undefined, {
|
|
188
188
|
authStrategy,
|
|
189
189
|
dynamicContextEnabled: true,
|
|
190
|
-
|
|
191
|
-
? { toolDescriptions: descriptionsWithoutReadme }
|
|
192
|
-
: {})
|
|
190
|
+
toolDescriptions: descriptionsWithoutReadme
|
|
193
191
|
});
|
|
194
192
|
}
|
|
195
193
|
// Register API tools
|
|
196
194
|
if (api) {
|
|
197
195
|
const { tools: apiTools, disableTools, enableTools, toolDescriptions, toolHints, maxResponseSize, codeModeBaseUrl = 'https://mcp.wix.com' } = api;
|
|
198
196
|
// Precedence (low → high): README-free defaults, code-mode variant, consumer overrides.
|
|
199
|
-
const effectiveToolDescriptions =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
...descriptionsWithoutReadme,
|
|
205
|
-
...(executeWixApiRequested ? executeCodeModeToolDescriptions : {}),
|
|
206
|
-
...toolDescriptions
|
|
207
|
-
};
|
|
197
|
+
const effectiveToolDescriptions = {
|
|
198
|
+
...descriptionsWithoutReadme,
|
|
199
|
+
...(executeWixApiRequested ? executeCodeModeToolDescriptions : {}),
|
|
200
|
+
...toolDescriptions
|
|
201
|
+
};
|
|
208
202
|
addApiCallTool(server, authStrategy, apiTools, disableTools, enableTools, effectiveToolDescriptions, toolHints, maxResponseSize);
|
|
209
203
|
const requestedTools = new Set([
|
|
210
204
|
...(apiTools ?? []),
|