@wisewandtools/mcp-server 2.0.9 → 2.0.11

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 CHANGED
@@ -289,6 +289,21 @@ var WisewandAPIClient = class {
289
289
  }, this.config.timeout);
290
290
  try {
291
291
  const bodyJSON = body ? JSON.stringify(body) : void 0;
292
+ console.error("=".repeat(80));
293
+ console.error("HTTP REQUEST - EXACT PAYLOAD");
294
+ console.error("=".repeat(80));
295
+ console.error("Method:", method);
296
+ console.error("URL:", url);
297
+ console.error("Body JSON:", bodyJSON);
298
+ console.error(
299
+ "Body includes apply_project_brief_config:",
300
+ bodyJSON?.includes("apply_project_brief_config")
301
+ );
302
+ if (bodyJSON && bodyJSON.includes("apply_project_brief_config")) {
303
+ const match = bodyJSON.match(/"apply_project_brief_config":\s*(\w+)/);
304
+ console.error("apply_project_brief_config value in JSON:", match ? match[1] : "NOT FOUND");
305
+ }
306
+ console.error("");
292
307
  logger.info("API HTTP REQUEST - EXACT JSON", {
293
308
  method,
294
309
  endpoint,
@@ -504,6 +519,13 @@ var WisewandAPIClient = class {
504
519
  }
505
520
  // ============= Content Discovery =============
506
521
  async discoverArticles(input) {
522
+ console.error("=".repeat(80));
523
+ console.error("API CLIENT - DISCOVER ARTICLES");
524
+ console.error("=".repeat(80));
525
+ console.error("Input payload:", JSON.stringify(input, null, 2));
526
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in input);
527
+ console.error("apply_project_brief_config value:", input.apply_project_brief_config);
528
+ console.error("");
507
529
  logger.info("API Client discoverArticles - INPUT TO API", {
508
530
  input_keys: Object.keys(input),
509
531
  has_apply_project_brief_config: "apply_project_brief_config" in input,
@@ -1161,7 +1183,7 @@ var HealthChecker = class {
1161
1183
  import { z as z2 } from "zod";
1162
1184
  var boolField = z2.union([z2.boolean(), z2.string()]).transform(
1163
1185
  (val) => typeof val === "string" ? val === "true" : val
1164
- ).optional();
1186
+ ).optional().default(false);
1165
1187
  var numField = z2.union([z2.number(), z2.string()]).transform(
1166
1188
  (val) => typeof val === "string" ? parseInt(val, 10) : val
1167
1189
  ).optional();
@@ -1412,7 +1434,7 @@ var ArticleToolHandler = class {
1412
1434
  project_id: { type: "string", format: "uuid", description: "Project ID to associate with the article" },
1413
1435
  writing_style_mode: { type: "string", enum: ["auto", "persona"], description: "Writing style mode", default: "auto" },
1414
1436
  persona_id: { type: "string", format: "uuid", description: 'Persona ID for writing style (required if writing_style_mode is "persona")' },
1415
- apply_project_brief_config: { type: "boolean", description: "Apply the project brief configuration" },
1437
+ apply_project_brief_config: { type: "boolean", description: "Apply the project brief configuration", default: false },
1416
1438
  // CTA
1417
1439
  use_cta: { type: "boolean", description: "Include call-to-action buttons" },
1418
1440
  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" },
@@ -1520,7 +1542,7 @@ var ArticleToolHandler = class {
1520
1542
  inputSchema: {
1521
1543
  type: "object",
1522
1544
  properties: this.buildArticleInputSchema(),
1523
- required: ["subject"]
1545
+ required: ["subject", "apply_project_brief_config"]
1524
1546
  },
1525
1547
  handler: /* @__PURE__ */ __name(async (args) => {
1526
1548
  try {
@@ -3935,7 +3957,7 @@ var ProductPagesToolHandler = class {
3935
3957
  import { z as z8 } from "zod";
3936
3958
  var boolField2 = z8.union([z8.boolean(), z8.string()]).transform(
3937
3959
  (val) => typeof val === "string" ? val === "true" : val
3938
- ).optional();
3960
+ ).optional().default(false);
3939
3961
  var DiscoverContentSchema = z8.object({
3940
3962
  subject: z8.string().min(1),
3941
3963
  target_keyword: z8.string().optional(),
@@ -4038,7 +4060,7 @@ var DiscoverToolHandler = class {
4038
4060
  keywords_secondary: { type: "string", description: "Secondary keywords" },
4039
4061
  project_id: { type: "string", format: "uuid", description: "Project UUID" },
4040
4062
  persona_id: { type: "string", format: "uuid", description: "Persona UUID" },
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." },
4063
+ 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 },
4042
4064
  lang: { type: "string", enum: ["fr", "en"], description: "Language code" },
4043
4065
  country: { type: "string", enum: ["fr", "be", "ch", "ca", "us", "gb"], description: "Country code" },
4044
4066
  length: { description: 'Number (max 2000) or "auto"' },
@@ -4095,16 +4117,32 @@ var DiscoverToolHandler = class {
4095
4117
  use_webhook: { type: "boolean", description: "Trigger webhook" },
4096
4118
  webhook_connection_id: { type: "string", description: "Webhook connection ID" }
4097
4119
  },
4098
- required: ["subject"]
4120
+ required: ["subject", "apply_project_brief_config"]
4099
4121
  },
4100
4122
  handler: /* @__PURE__ */ __name(async (args) => {
4101
4123
  try {
4124
+ console.error("=".repeat(80));
4125
+ console.error("MCP DISCOVER_CONTENT - STAGE 1: RAW INPUT");
4126
+ console.error("=".repeat(80));
4127
+ console.error("Raw args:", JSON.stringify(args, null, 2));
4128
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in args);
4129
+ console.error("apply_project_brief_config value:", args.apply_project_brief_config);
4130
+ console.error("apply_project_brief_config type:", typeof args.apply_project_brief_config);
4131
+ console.error("");
4102
4132
  logger.info("discover_content RAW INPUT", {
4103
4133
  raw_args: args,
4104
4134
  apply_project_brief_config_raw: args.apply_project_brief_config,
4105
4135
  apply_project_brief_config_raw_type: typeof args.apply_project_brief_config
4106
4136
  });
4107
4137
  const validated = DiscoverContentSchema.parse(args);
4138
+ console.error("=".repeat(80));
4139
+ console.error("MCP DISCOVER_CONTENT - STAGE 2: AFTER VALIDATION");
4140
+ console.error("=".repeat(80));
4141
+ console.error("Validated:", JSON.stringify(validated, null, 2));
4142
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in validated);
4143
+ console.error("apply_project_brief_config value:", validated.apply_project_brief_config);
4144
+ console.error("apply_project_brief_config type:", typeof validated.apply_project_brief_config);
4145
+ console.error("");
4108
4146
  logger.info("discover_content VALIDATED (after boolField transform)", {
4109
4147
  apply_project_brief_config: validated.apply_project_brief_config,
4110
4148
  apply_project_brief_config_type: typeof validated.apply_project_brief_config,
@@ -4117,6 +4155,13 @@ var DiscoverToolHandler = class {
4117
4155
  cleanedInput[key] = value;
4118
4156
  }
4119
4157
  }
4158
+ console.error("=".repeat(80));
4159
+ console.error("MCP DISCOVER_CONTENT - STAGE 3: CLEANED INPUT");
4160
+ console.error("=".repeat(80));
4161
+ console.error("Cleaned input:", JSON.stringify(cleanedInput, null, 2));
4162
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in cleanedInput);
4163
+ console.error("apply_project_brief_config value:", cleanedInput.apply_project_brief_config);
4164
+ console.error("");
4120
4165
  logger.info("discover_content CLEANED INPUT (undefined removed)", {
4121
4166
  before_cleaning_keys: Object.keys(validated).length,
4122
4167
  after_cleaning_keys: Object.keys(cleanedInput).length,
@@ -4124,6 +4169,11 @@ var DiscoverToolHandler = class {
4124
4169
  apply_project_brief_config_value: cleanedInput.apply_project_brief_config
4125
4170
  });
4126
4171
  const discovery = await this.apiClient.discoverArticles(cleanedInput);
4172
+ console.error("=".repeat(80));
4173
+ console.error("MCP DISCOVER_CONTENT - STAGE 4: API RESPONSE");
4174
+ console.error("=".repeat(80));
4175
+ console.error("Discovery ID:", discovery.id);
4176
+ console.error("");
4127
4177
  await this.cache.set(`discover:${discovery.id}`, discovery, 300);
4128
4178
  this.metrics.recordAPICall("discover_content", "success");
4129
4179
  return {