@wisewandtools/mcp-server 2.0.8 → 2.0.10
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/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -289,13 +289,14 @@ var WisewandAPIClient = class {
|
|
|
289
289
|
}, this.config.timeout);
|
|
290
290
|
try {
|
|
291
291
|
const bodyJSON = body ? JSON.stringify(body) : void 0;
|
|
292
|
-
logger.info("API HTTP REQUEST", {
|
|
292
|
+
logger.info("API HTTP REQUEST - EXACT JSON", {
|
|
293
293
|
method,
|
|
294
294
|
endpoint,
|
|
295
295
|
url,
|
|
296
|
-
body,
|
|
297
296
|
bodyJSON,
|
|
298
|
-
|
|
297
|
+
// The EXACT string being sent over HTTP
|
|
298
|
+
body_includes_apply_project_brief_config: bodyJSON?.includes("apply_project_brief_config"),
|
|
299
|
+
body_apply_project_brief_config_value: bodyJSON?.match(/"apply_project_brief_config":(true|false)/)?.[1]
|
|
299
300
|
});
|
|
300
301
|
const response = await fetch(url, {
|
|
301
302
|
method,
|
|
@@ -504,14 +505,23 @@ var WisewandAPIClient = class {
|
|
|
504
505
|
// ============= Content Discovery =============
|
|
505
506
|
async discoverArticles(input) {
|
|
506
507
|
logger.info("API Client discoverArticles - INPUT TO API", {
|
|
507
|
-
|
|
508
|
+
input_keys: Object.keys(input),
|
|
509
|
+
has_apply_project_brief_config: "apply_project_brief_config" in input,
|
|
510
|
+
apply_project_brief_config_value: input.apply_project_brief_config,
|
|
508
511
|
apply_project_brief_config_type: typeof input.apply_project_brief_config,
|
|
509
512
|
has_project_id: !!input.project_id,
|
|
510
513
|
subject: input.subject,
|
|
511
|
-
endpoint: "/v1/discoverarticles/"
|
|
512
|
-
full_input: input
|
|
514
|
+
endpoint: "/v1/discoverarticles/"
|
|
513
515
|
});
|
|
514
|
-
|
|
516
|
+
const requestBody = { ...input };
|
|
517
|
+
if (input.apply_project_brief_config !== void 0) {
|
|
518
|
+
requestBody.apply_project_brief_config = Boolean(input.apply_project_brief_config);
|
|
519
|
+
logger.info("API Client - Explicitly set apply_project_brief_config", {
|
|
520
|
+
original_value: input.apply_project_brief_config,
|
|
521
|
+
explicit_boolean: requestBody.apply_project_brief_config
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
return this.request("POST", "/v1/discoverarticles/", requestBody);
|
|
515
525
|
}
|
|
516
526
|
async getDiscoverArticle(id) {
|
|
517
527
|
return this.request("GET", `/v1/discoverarticles/${id}`);
|
|
@@ -1151,7 +1161,7 @@ var HealthChecker = class {
|
|
|
1151
1161
|
import { z as z2 } from "zod";
|
|
1152
1162
|
var boolField = z2.union([z2.boolean(), z2.string()]).transform(
|
|
1153
1163
|
(val) => typeof val === "string" ? val === "true" : val
|
|
1154
|
-
).optional();
|
|
1164
|
+
).optional().default(false);
|
|
1155
1165
|
var numField = z2.union([z2.number(), z2.string()]).transform(
|
|
1156
1166
|
(val) => typeof val === "string" ? parseInt(val, 10) : val
|
|
1157
1167
|
).optional();
|
|
@@ -1402,7 +1412,7 @@ var ArticleToolHandler = class {
|
|
|
1402
1412
|
project_id: { type: "string", format: "uuid", description: "Project ID to associate with the article" },
|
|
1403
1413
|
writing_style_mode: { type: "string", enum: ["auto", "persona"], description: "Writing style mode", default: "auto" },
|
|
1404
1414
|
persona_id: { type: "string", format: "uuid", description: 'Persona ID for writing style (required if writing_style_mode is "persona")' },
|
|
1405
|
-
apply_project_brief_config: { type: "boolean", description: "Apply the project brief configuration" },
|
|
1415
|
+
apply_project_brief_config: { type: "boolean", description: "Apply the project brief configuration", default: false },
|
|
1406
1416
|
// CTA
|
|
1407
1417
|
use_cta: { type: "boolean", description: "Include call-to-action buttons" },
|
|
1408
1418
|
ctas: { type: "array", items: { type: "object", properties: { anchor: { type: "string" }, url: { type: "string" } }, required: ["anchor", "url"] }, description: "Call-to-action items with anchor text and URL" },
|
|
@@ -1510,7 +1520,7 @@ var ArticleToolHandler = class {
|
|
|
1510
1520
|
inputSchema: {
|
|
1511
1521
|
type: "object",
|
|
1512
1522
|
properties: this.buildArticleInputSchema(),
|
|
1513
|
-
required: ["subject"]
|
|
1523
|
+
required: ["subject", "apply_project_brief_config"]
|
|
1514
1524
|
},
|
|
1515
1525
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
1516
1526
|
try {
|
|
@@ -3925,7 +3935,7 @@ var ProductPagesToolHandler = class {
|
|
|
3925
3935
|
import { z as z8 } from "zod";
|
|
3926
3936
|
var boolField2 = z8.union([z8.boolean(), z8.string()]).transform(
|
|
3927
3937
|
(val) => typeof val === "string" ? val === "true" : val
|
|
3928
|
-
).optional();
|
|
3938
|
+
).optional().default(false);
|
|
3929
3939
|
var DiscoverContentSchema = z8.object({
|
|
3930
3940
|
subject: z8.string().min(1),
|
|
3931
3941
|
target_keyword: z8.string().optional(),
|
|
@@ -4028,7 +4038,7 @@ var DiscoverToolHandler = class {
|
|
|
4028
4038
|
keywords_secondary: { type: "string", description: "Secondary keywords" },
|
|
4029
4039
|
project_id: { type: "string", format: "uuid", description: "Project UUID" },
|
|
4030
4040
|
persona_id: { type: "string", format: "uuid", description: "Persona UUID" },
|
|
4031
|
-
apply_project_brief_config: { type: "boolean", description: "Apply project brief configuration settings. When true, inherits all feature flags and settings from the project brief (use_faq, use_toc, use_inline_images, internal links, etc.). Recommended for consistency." },
|
|
4041
|
+
apply_project_brief_config: { type: "boolean", description: "Apply project brief configuration settings. When true, inherits all feature flags and settings from the project brief (use_faq, use_toc, use_inline_images, internal links, etc.). Recommended for consistency.", default: false },
|
|
4032
4042
|
lang: { type: "string", enum: ["fr", "en"], description: "Language code" },
|
|
4033
4043
|
country: { type: "string", enum: ["fr", "be", "ch", "ca", "us", "gb"], description: "Country code" },
|
|
4034
4044
|
length: { description: 'Number (max 2000) or "auto"' },
|
|
@@ -4085,7 +4095,7 @@ var DiscoverToolHandler = class {
|
|
|
4085
4095
|
use_webhook: { type: "boolean", description: "Trigger webhook" },
|
|
4086
4096
|
webhook_connection_id: { type: "string", description: "Webhook connection ID" }
|
|
4087
4097
|
},
|
|
4088
|
-
required: ["subject"]
|
|
4098
|
+
required: ["subject", "apply_project_brief_config"]
|
|
4089
4099
|
},
|
|
4090
4100
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4091
4101
|
try {
|
|
@@ -4101,10 +4111,44 @@ var DiscoverToolHandler = class {
|
|
|
4101
4111
|
has_project_id: !!validated.project_id,
|
|
4102
4112
|
full_validated: validated
|
|
4103
4113
|
});
|
|
4104
|
-
const
|
|
4114
|
+
const cleanedInput = {};
|
|
4115
|
+
for (const [key, value] of Object.entries(validated)) {
|
|
4116
|
+
if (value !== void 0 && value !== null) {
|
|
4117
|
+
cleanedInput[key] = value;
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
logger.info("discover_content CLEANED INPUT (undefined removed)", {
|
|
4121
|
+
before_cleaning_keys: Object.keys(validated).length,
|
|
4122
|
+
after_cleaning_keys: Object.keys(cleanedInput).length,
|
|
4123
|
+
apply_project_brief_config_included: "apply_project_brief_config" in cleanedInput,
|
|
4124
|
+
apply_project_brief_config_value: cleanedInput.apply_project_brief_config
|
|
4125
|
+
});
|
|
4126
|
+
const discovery = await this.apiClient.discoverArticles(cleanedInput);
|
|
4105
4127
|
await this.cache.set(`discover:${discovery.id}`, discovery, 300);
|
|
4106
4128
|
this.metrics.recordAPICall("discover_content", "success");
|
|
4107
|
-
return {
|
|
4129
|
+
return {
|
|
4130
|
+
content: [{
|
|
4131
|
+
type: "text",
|
|
4132
|
+
text: JSON.stringify({
|
|
4133
|
+
success: true,
|
|
4134
|
+
discovery_id: discovery.id,
|
|
4135
|
+
message: "Content discovery created successfully",
|
|
4136
|
+
// DIAGNOSTIC INFORMATION - shows what MCP received and validated
|
|
4137
|
+
debug_info: {
|
|
4138
|
+
raw_input_has_param: "apply_project_brief_config" in args,
|
|
4139
|
+
raw_input_value: args.apply_project_brief_config,
|
|
4140
|
+
raw_input_type: typeof args.apply_project_brief_config,
|
|
4141
|
+
validated_has_param: "apply_project_brief_config" in validated,
|
|
4142
|
+
validated_value: validated.apply_project_brief_config,
|
|
4143
|
+
validated_type: typeof validated.apply_project_brief_config
|
|
4144
|
+
},
|
|
4145
|
+
next_steps: [
|
|
4146
|
+
`Use 'run_discovery' with id: ${discovery.id}`,
|
|
4147
|
+
`Use 'get_discover_result' with id: ${discovery.id}`
|
|
4148
|
+
]
|
|
4149
|
+
}, null, 2)
|
|
4150
|
+
}]
|
|
4151
|
+
};
|
|
4108
4152
|
} catch (error) {
|
|
4109
4153
|
logger.error("Failed to create discovery", { error: error.message });
|
|
4110
4154
|
this.metrics.recordAPICall("discover_content", "error");
|