@wisewandtools/mcp-server 2.0.17 → 2.0.18
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 +30 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -370,10 +370,10 @@ var WisewandAPIClient = class {
|
|
|
370
370
|
return this.request("POST", "/v1/articles/cost", input);
|
|
371
371
|
}
|
|
372
372
|
async createBulkArticles(articles) {
|
|
373
|
-
return this.request("POST", "/v1/articles/bulk", articles);
|
|
373
|
+
return this.request("POST", "/v1/articles/bulk", { articles });
|
|
374
374
|
}
|
|
375
375
|
async calculateBulkCost(articles) {
|
|
376
|
-
return this.request("POST", "/v1/articles/bulk/cost", articles);
|
|
376
|
+
return this.request("POST", "/v1/articles/bulk/cost", { articles });
|
|
377
377
|
}
|
|
378
378
|
// ============= Project Operations =============
|
|
379
379
|
async createProject(input) {
|
|
@@ -1139,7 +1139,7 @@ var CreateArticleSchema = z2.object({
|
|
|
1139
1139
|
title: z2.string().optional(),
|
|
1140
1140
|
keep_title: boolField,
|
|
1141
1141
|
type: z2.enum(["blog", "affiliation-product-review", "affiliation-compare-products", "affiliation-top-product"]).optional().default("blog"),
|
|
1142
|
-
lang: z2.enum(LANG_ENUM).optional()
|
|
1142
|
+
lang: z2.enum(LANG_ENUM).optional(),
|
|
1143
1143
|
country: z2.enum(COUNTRY_ENUM).optional(),
|
|
1144
1144
|
length: z2.union([z2.number().max(5e3), z2.literal("auto")]).optional().default("auto"),
|
|
1145
1145
|
target_keyword: z2.string().optional(),
|
|
@@ -1764,7 +1764,7 @@ var ArticleToolHandler = class {
|
|
|
1764
1764
|
try {
|
|
1765
1765
|
const cost = await this.apiClient.calculateArticleCost(args);
|
|
1766
1766
|
this.metrics.recordAPICall("estimate_cost", "success");
|
|
1767
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, cost_estimate: cost, message: `Estimated cost: ${cost.credits} credits ($${cost.
|
|
1767
|
+
return { content: [{ type: "text", text: JSON.stringify({ success: true, cost_estimate: cost, message: `Estimated cost: ${cost.credits} credits ($${cost.cost_usd})` }, null, 2) }] };
|
|
1768
1768
|
} catch (error) {
|
|
1769
1769
|
logger.error("Failed to estimate cost", { error: error.message });
|
|
1770
1770
|
this.metrics.recordAPICall("estimate_cost", "error");
|
|
@@ -3460,6 +3460,15 @@ var CategoryPagesToolHandler = class {
|
|
|
3460
3460
|
static {
|
|
3461
3461
|
__name(this, "CategoryPagesToolHandler");
|
|
3462
3462
|
}
|
|
3463
|
+
buildApiInput(validated) {
|
|
3464
|
+
const input = {};
|
|
3465
|
+
Object.keys(validated).forEach((key) => {
|
|
3466
|
+
if (validated[key] !== void 0 && validated[key] !== null) {
|
|
3467
|
+
input[key] = validated[key];
|
|
3468
|
+
}
|
|
3469
|
+
});
|
|
3470
|
+
return input;
|
|
3471
|
+
}
|
|
3463
3472
|
getTools() {
|
|
3464
3473
|
return [
|
|
3465
3474
|
this.createCategoryPageTool(),
|
|
@@ -3508,11 +3517,13 @@ var CategoryPagesToolHandler = class {
|
|
|
3508
3517
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
3509
3518
|
try {
|
|
3510
3519
|
const validated = CreateCategoryPageSchema.parse(args);
|
|
3511
|
-
const
|
|
3520
|
+
const input = this.buildApiInput(validated);
|
|
3521
|
+
const categoryPage = await this.apiClient.createCategoryPage(input);
|
|
3512
3522
|
await this.cache.set(`category_page:${categoryPage.id}`, categoryPage, 300);
|
|
3513
3523
|
this.metrics.recordAPICall("create_category_page", "success");
|
|
3524
|
+
const displayName = categoryPage.name || validated.name || args.name || "Unnamed";
|
|
3514
3525
|
return {
|
|
3515
|
-
content: [{ type: "text", text: JSON.stringify({ success: true, category_page_id: categoryPage.id, name:
|
|
3526
|
+
content: [{ type: "text", text: JSON.stringify({ success: true, category_page_id: categoryPage.id, name: displayName, message: `Category page "${displayName}" created successfully`, next_steps: [`Use 'generate_category_page' with id: ${categoryPage.id}`, `Use 'get_category_page' with id: ${categoryPage.id}`] }, null, 2) }]
|
|
3516
3527
|
};
|
|
3517
3528
|
} catch (error) {
|
|
3518
3529
|
logger.error("Failed to create category page", { error: error.message });
|
|
@@ -3761,6 +3772,15 @@ var ProductPagesToolHandler = class {
|
|
|
3761
3772
|
static {
|
|
3762
3773
|
__name(this, "ProductPagesToolHandler");
|
|
3763
3774
|
}
|
|
3775
|
+
buildApiInput(validated) {
|
|
3776
|
+
const input = {};
|
|
3777
|
+
Object.keys(validated).forEach((key) => {
|
|
3778
|
+
if (validated[key] !== void 0 && validated[key] !== null) {
|
|
3779
|
+
input[key] = validated[key];
|
|
3780
|
+
}
|
|
3781
|
+
});
|
|
3782
|
+
return input;
|
|
3783
|
+
}
|
|
3764
3784
|
getTools() {
|
|
3765
3785
|
return [
|
|
3766
3786
|
this.createProductPageTool(),
|
|
@@ -3811,10 +3831,12 @@ var ProductPagesToolHandler = class {
|
|
|
3811
3831
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
3812
3832
|
try {
|
|
3813
3833
|
const validated = CreateProductPageSchema.parse(args);
|
|
3814
|
-
const
|
|
3834
|
+
const input = this.buildApiInput(validated);
|
|
3835
|
+
const productPage = await this.apiClient.createProductPage(input);
|
|
3815
3836
|
await this.cache.set(`product_page:${productPage.id}`, productPage, 300);
|
|
3816
3837
|
this.metrics.recordAPICall("create_product_page", "success");
|
|
3817
|
-
|
|
3838
|
+
const displayName = productPage.name || validated.name || args.name || "Unnamed";
|
|
3839
|
+
return { content: [{ type: "text", text: JSON.stringify({ success: true, product_page_id: productPage.id, name: displayName, message: `Product page "${displayName}" created successfully`, next_steps: [`Use 'generate_product_page' with id: ${productPage.id}`, `Use 'get_product_page' with id: ${productPage.id}`] }, null, 2) }] };
|
|
3818
3840
|
} catch (error) {
|
|
3819
3841
|
logger.error("Failed to create product page", { error: error.message });
|
|
3820
3842
|
this.metrics.recordAPICall("create_product_page", "error");
|