@wisewandtools/mcp-server 2.0.10 → 2.0.12

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,24 +519,12 @@ var WisewandAPIClient = class {
504
519
  }
505
520
  // ============= Content Discovery =============
506
521
  async discoverArticles(input) {
507
- logger.info("API Client discoverArticles - INPUT TO API", {
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,
511
- apply_project_brief_config_type: typeof input.apply_project_brief_config,
512
- has_project_id: !!input.project_id,
513
- subject: input.subject,
514
- endpoint: "/v1/discoverarticles/"
515
- });
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);
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("");
527
+ return this.request("POST", "/v1/discoverarticles/", input);
525
528
  }
526
529
  async getDiscoverArticle(id) {
527
530
  return this.request("GET", `/v1/discoverarticles/${id}`);
@@ -4099,12 +4102,28 @@ var DiscoverToolHandler = class {
4099
4102
  },
4100
4103
  handler: /* @__PURE__ */ __name(async (args) => {
4101
4104
  try {
4105
+ console.error("=".repeat(80));
4106
+ console.error("MCP DISCOVER_CONTENT - STAGE 1: RAW INPUT");
4107
+ console.error("=".repeat(80));
4108
+ console.error("Raw args:", JSON.stringify(args, null, 2));
4109
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in args);
4110
+ console.error("apply_project_brief_config value:", args.apply_project_brief_config);
4111
+ console.error("apply_project_brief_config type:", typeof args.apply_project_brief_config);
4112
+ console.error("");
4102
4113
  logger.info("discover_content RAW INPUT", {
4103
4114
  raw_args: args,
4104
4115
  apply_project_brief_config_raw: args.apply_project_brief_config,
4105
4116
  apply_project_brief_config_raw_type: typeof args.apply_project_brief_config
4106
4117
  });
4107
4118
  const validated = DiscoverContentSchema.parse(args);
4119
+ console.error("=".repeat(80));
4120
+ console.error("MCP DISCOVER_CONTENT - STAGE 2: AFTER VALIDATION");
4121
+ console.error("=".repeat(80));
4122
+ console.error("Validated:", JSON.stringify(validated, null, 2));
4123
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in validated);
4124
+ console.error("apply_project_brief_config value:", validated.apply_project_brief_config);
4125
+ console.error("apply_project_brief_config type:", typeof validated.apply_project_brief_config);
4126
+ console.error("");
4108
4127
  logger.info("discover_content VALIDATED (after boolField transform)", {
4109
4128
  apply_project_brief_config: validated.apply_project_brief_config,
4110
4129
  apply_project_brief_config_type: typeof validated.apply_project_brief_config,
@@ -4117,6 +4136,13 @@ var DiscoverToolHandler = class {
4117
4136
  cleanedInput[key] = value;
4118
4137
  }
4119
4138
  }
4139
+ console.error("=".repeat(80));
4140
+ console.error("MCP DISCOVER_CONTENT - STAGE 3: CLEANED INPUT");
4141
+ console.error("=".repeat(80));
4142
+ console.error("Cleaned input:", JSON.stringify(cleanedInput, null, 2));
4143
+ console.error("apply_project_brief_config present:", "apply_project_brief_config" in cleanedInput);
4144
+ console.error("apply_project_brief_config value:", cleanedInput.apply_project_brief_config);
4145
+ console.error("");
4120
4146
  logger.info("discover_content CLEANED INPUT (undefined removed)", {
4121
4147
  before_cleaning_keys: Object.keys(validated).length,
4122
4148
  after_cleaning_keys: Object.keys(cleanedInput).length,
@@ -4124,6 +4150,11 @@ var DiscoverToolHandler = class {
4124
4150
  apply_project_brief_config_value: cleanedInput.apply_project_brief_config
4125
4151
  });
4126
4152
  const discovery = await this.apiClient.discoverArticles(cleanedInput);
4153
+ console.error("=".repeat(80));
4154
+ console.error("MCP DISCOVER_CONTENT - STAGE 4: API RESPONSE");
4155
+ console.error("=".repeat(80));
4156
+ console.error("Discovery ID:", discovery.id);
4157
+ console.error("");
4127
4158
  await this.cache.set(`discover:${discovery.id}`, discovery, 300);
4128
4159
  this.metrics.recordAPICall("discover_content", "success");
4129
4160
  return {