@wisewandtools/mcp-server 2.0.8 → 2.0.9
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 +53 -9
- 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}`);
|
|
@@ -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");
|