@wisewandtools/mcp-server 2.0.5 → 2.0.8

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
@@ -288,11 +288,19 @@ var WisewandAPIClient = class {
288
288
  this.abortController.abort();
289
289
  }, this.config.timeout);
290
290
  try {
291
- logger.debug("API request", { method, endpoint, body });
291
+ const bodyJSON = body ? JSON.stringify(body) : void 0;
292
+ logger.info("API HTTP REQUEST", {
293
+ method,
294
+ endpoint,
295
+ url,
296
+ body,
297
+ bodyJSON,
298
+ body_includes_apply_project_brief_config: body?.apply_project_brief_config !== void 0
299
+ });
292
300
  const response = await fetch(url, {
293
301
  method,
294
302
  headers: this.headers,
295
- body: body ? JSON.stringify(body) : void 0,
303
+ body: bodyJSON,
296
304
  signal: this.abortController.signal,
297
305
  ...options
298
306
  });
@@ -495,6 +503,14 @@ var WisewandAPIClient = class {
495
503
  }
496
504
  // ============= Content Discovery =============
497
505
  async discoverArticles(input) {
506
+ logger.info("API Client discoverArticles - INPUT TO API", {
507
+ apply_project_brief_config: input.apply_project_brief_config,
508
+ apply_project_brief_config_type: typeof input.apply_project_brief_config,
509
+ has_project_id: !!input.project_id,
510
+ subject: input.subject,
511
+ endpoint: "/v1/discoverarticles/",
512
+ full_input: input
513
+ });
498
514
  return this.request("POST", "/v1/discoverarticles/", input);
499
515
  }
500
516
  async getDiscoverArticle(id) {
@@ -3907,12 +3923,16 @@ var ProductPagesToolHandler = class {
3907
3923
 
3908
3924
  // src/handlers/tools/DiscoverToolHandler.ts
3909
3925
  import { z as z8 } from "zod";
3926
+ var boolField2 = z8.union([z8.boolean(), z8.string()]).transform(
3927
+ (val) => typeof val === "string" ? val === "true" : val
3928
+ ).optional();
3910
3929
  var DiscoverContentSchema = z8.object({
3911
3930
  subject: z8.string().min(1),
3912
3931
  target_keyword: z8.string().optional(),
3913
3932
  keywords_secondary: z8.string().optional(),
3914
3933
  project_id: z8.string().uuid().optional(),
3915
3934
  persona_id: z8.string().uuid().optional(),
3935
+ apply_project_brief_config: boolField2,
3916
3936
  lang: z8.enum(["fr", "en"]).optional(),
3917
3937
  country: z8.enum(["fr", "be", "ch", "ca", "us", "gb"]).optional(),
3918
3938
  length: z8.union([z8.number().max(2e3), z8.literal("auto")]).optional(),
@@ -4008,6 +4028,7 @@ var DiscoverToolHandler = class {
4008
4028
  keywords_secondary: { type: "string", description: "Secondary keywords" },
4009
4029
  project_id: { type: "string", format: "uuid", description: "Project UUID" },
4010
4030
  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." },
4011
4032
  lang: { type: "string", enum: ["fr", "en"], description: "Language code" },
4012
4033
  country: { type: "string", enum: ["fr", "be", "ch", "ca", "us", "gb"], description: "Country code" },
4013
4034
  length: { description: 'Number (max 2000) or "auto"' },
@@ -4068,7 +4089,18 @@ var DiscoverToolHandler = class {
4068
4089
  },
4069
4090
  handler: /* @__PURE__ */ __name(async (args) => {
4070
4091
  try {
4092
+ logger.info("discover_content RAW INPUT", {
4093
+ raw_args: args,
4094
+ apply_project_brief_config_raw: args.apply_project_brief_config,
4095
+ apply_project_brief_config_raw_type: typeof args.apply_project_brief_config
4096
+ });
4071
4097
  const validated = DiscoverContentSchema.parse(args);
4098
+ logger.info("discover_content VALIDATED (after boolField transform)", {
4099
+ apply_project_brief_config: validated.apply_project_brief_config,
4100
+ apply_project_brief_config_type: typeof validated.apply_project_brief_config,
4101
+ has_project_id: !!validated.project_id,
4102
+ full_validated: validated
4103
+ });
4072
4104
  const discovery = await this.apiClient.discoverArticles(validated);
4073
4105
  await this.cache.set(`discover:${discovery.id}`, discovery, 300);
4074
4106
  this.metrics.recordAPICall("discover_content", "success");