@wisewandtools/mcp-server 2.0.12 → 2.0.14
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/README.md +33 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +134 -301
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -289,21 +289,6 @@ 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("");
|
|
307
292
|
logger.info("API HTTP REQUEST - EXACT JSON", {
|
|
308
293
|
method,
|
|
309
294
|
endpoint,
|
|
@@ -519,11 +504,6 @@ var WisewandAPIClient = class {
|
|
|
519
504
|
}
|
|
520
505
|
// ============= Content Discovery =============
|
|
521
506
|
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("");
|
|
527
507
|
return this.request("POST", "/v1/discoverarticles/", input);
|
|
528
508
|
}
|
|
529
509
|
async getDiscoverArticle(id) {
|
|
@@ -565,32 +545,6 @@ var WisewandAPIClient = class {
|
|
|
565
545
|
async deleteFeed(id) {
|
|
566
546
|
return this.request("DELETE", `/v1/feeds/${id}`);
|
|
567
547
|
}
|
|
568
|
-
// ============= Update Posts =============
|
|
569
|
-
async createUpdatePost(input) {
|
|
570
|
-
return this.request("POST", "/v1/updateposts/", input);
|
|
571
|
-
}
|
|
572
|
-
async getUpdatePost(id) {
|
|
573
|
-
return this.request("GET", `/v1/updateposts/${id}`);
|
|
574
|
-
}
|
|
575
|
-
async listUpdatePosts(params = {}) {
|
|
576
|
-
const query = this.buildQuery(params);
|
|
577
|
-
return this.request("GET", `/v1/updateposts/?${query}`);
|
|
578
|
-
}
|
|
579
|
-
async updateUpdatePost(id, updates) {
|
|
580
|
-
return this.request("PATCH", `/v1/updateposts/${id}`, updates);
|
|
581
|
-
}
|
|
582
|
-
async getUpdatePostOutput(id) {
|
|
583
|
-
return this.request("GET", `/v1/updateposts/${id}/output`);
|
|
584
|
-
}
|
|
585
|
-
async runUpdatePost(id) {
|
|
586
|
-
return this.request("POST", `/v1/updateposts/${id}/run`, {});
|
|
587
|
-
}
|
|
588
|
-
async calculateUpdatePostCost(input) {
|
|
589
|
-
return this.request("POST", "/v1/updateposts/cost", input);
|
|
590
|
-
}
|
|
591
|
-
async createBulkUpdatePosts(items) {
|
|
592
|
-
return this.request("POST", "/v1/updateposts/bulk", { items });
|
|
593
|
-
}
|
|
594
548
|
// ============= Transactions =============
|
|
595
549
|
async listTransactions(params = {}) {
|
|
596
550
|
const query = this.buildQuery(params);
|
|
@@ -1190,7 +1144,7 @@ var CreateArticleSchema = z2.object({
|
|
|
1190
1144
|
subject: z2.string().min(1, "Subject is required"),
|
|
1191
1145
|
title: z2.string().optional(),
|
|
1192
1146
|
keep_title: boolField,
|
|
1193
|
-
type: z2.enum(["blog", "
|
|
1147
|
+
type: z2.enum(["blog", "affiliation-product-review", "affiliation-compare-products", "affiliation-top-product"]).optional().default("blog"),
|
|
1194
1148
|
lang: z2.enum(LANG_ENUM).optional().default("en"),
|
|
1195
1149
|
country: z2.enum(COUNTRY_ENUM).optional(),
|
|
1196
1150
|
length: z2.union([z2.number().max(5e3), z2.literal("auto")]).optional().default("auto"),
|
|
@@ -1403,7 +1357,7 @@ var ArticleToolHandler = class {
|
|
|
1403
1357
|
subject: { type: "string", description: "The main subject or topic of the article", minLength: 1 },
|
|
1404
1358
|
title: { type: "string", description: "Optional custom title (auto-generated if not provided)" },
|
|
1405
1359
|
keep_title: { type: "boolean", description: "Whether to keep the provided title or allow AI to modify it" },
|
|
1406
|
-
type: { type: "string", enum: ["blog", "
|
|
1360
|
+
type: { type: "string", enum: ["blog", "affiliation-product-review", "affiliation-compare-products", "affiliation-top-product"], description: "Type of article to generate", default: "blog" },
|
|
1407
1361
|
lang: { type: "string", enum: [...LANG_ENUM], description: "Language for the article", default: "en" },
|
|
1408
1362
|
country: { type: "string", enum: [...COUNTRY_ENUM], description: "Target country for localization" },
|
|
1409
1363
|
length: { oneOf: [{ type: "number", maximum: 5e3 }, { type: "string", const: "auto" }], description: 'Article length in words or "auto"', default: "auto" },
|
|
@@ -2790,7 +2744,7 @@ var BulkOperationsToolHandler = class {
|
|
|
2790
2744
|
title: { type: "string" },
|
|
2791
2745
|
type: {
|
|
2792
2746
|
type: "string",
|
|
2793
|
-
enum: ["blog", "
|
|
2747
|
+
enum: ["blog", "affiliation-product-review", "affiliation-compare-products", "affiliation-top-product"]
|
|
2794
2748
|
},
|
|
2795
2749
|
lang: { type: "string", enum: ["fr", "en"] },
|
|
2796
2750
|
target_keyword: { type: "string" },
|
|
@@ -3465,11 +3419,43 @@ var UtilityToolHandler = class {
|
|
|
3465
3419
|
|
|
3466
3420
|
// src/handlers/tools/CategoryPagesToolHandler.ts
|
|
3467
3421
|
import { z as z6 } from "zod";
|
|
3422
|
+
var boolField2 = z6.union([z6.boolean(), z6.string()]).transform(
|
|
3423
|
+
(val) => typeof val === "string" ? val === "true" : val
|
|
3424
|
+
).optional().default(false);
|
|
3425
|
+
var numField2 = z6.union([z6.number(), z6.string()]).transform(
|
|
3426
|
+
(val) => typeof val === "string" ? parseInt(val, 10) : val
|
|
3427
|
+
).optional();
|
|
3428
|
+
var LANG_ENUM2 = ["de", "en", "es", "fr", "it", "nl", "pl", "pt", "ro"];
|
|
3429
|
+
var COUNTRY_ENUM2 = ["ad", "ae", "ar", "at", "au", "be", "br", "ca", "ch", "cl", "co", "de", "eg", "es", "fr", "gb", "in", "it", "lu", "ma", "mx", "nl", "pe", "pl", "pt", "ro", "us", "za"];
|
|
3468
3430
|
var CreateCategoryPageSchema = z6.object({
|
|
3431
|
+
// Basic fields
|
|
3469
3432
|
name: z6.string().min(1, "Name is required"),
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3433
|
+
subject: z6.string().min(1, "Subject is required"),
|
|
3434
|
+
title: z6.string().optional(),
|
|
3435
|
+
category: z6.string().optional(),
|
|
3436
|
+
// Standard fields
|
|
3437
|
+
lang: z6.enum(LANG_ENUM2).optional().default("en"),
|
|
3438
|
+
country: z6.enum(COUNTRY_ENUM2).optional(),
|
|
3439
|
+
project_id: z6.string().uuid().optional(),
|
|
3440
|
+
persona_id: z6.string().uuid().optional(),
|
|
3441
|
+
apply_project_brief_config: boolField2,
|
|
3442
|
+
// SEO features
|
|
3443
|
+
use_faq: boolField2,
|
|
3444
|
+
use_toc: boolField2,
|
|
3445
|
+
use_image: boolField2,
|
|
3446
|
+
use_inlineimages: boolField2,
|
|
3447
|
+
// Additional fields that might be relevant
|
|
3448
|
+
target_keyword: z6.string().optional(),
|
|
3449
|
+
keywords_secondary: z6.string().optional(),
|
|
3450
|
+
additional_information: z6.string().optional(),
|
|
3451
|
+
length: z6.union([z6.number().max(5e3), z6.literal("auto")]).optional().default("auto"),
|
|
3452
|
+
// Publishing options
|
|
3453
|
+
use_publishwordpress: boolField2,
|
|
3454
|
+
publishwordpress_date: z6.string().optional(),
|
|
3455
|
+
publishwordpress_status: z6.enum(["draft", "publish", "future"]).optional(),
|
|
3456
|
+
publishwordpress_category: numField2,
|
|
3457
|
+
publishwordpress_author: numField2,
|
|
3458
|
+
publishwordpress_connection: z6.string().uuid().optional()
|
|
3473
3459
|
});
|
|
3474
3460
|
var CategoryPagesToolHandler = class {
|
|
3475
3461
|
constructor(apiClient, cache, metrics) {
|
|
@@ -3499,10 +3485,31 @@ var CategoryPagesToolHandler = class {
|
|
|
3499
3485
|
inputSchema: {
|
|
3500
3486
|
type: "object",
|
|
3501
3487
|
properties: {
|
|
3502
|
-
name: { type: "string", description: "Name of the category page", minLength: 1 },
|
|
3503
|
-
|
|
3488
|
+
name: { type: "string", description: "Name/identifier of the category page", minLength: 1 },
|
|
3489
|
+
subject: { type: "string", description: "Category subject/topic", minLength: 1 },
|
|
3490
|
+
title: { type: "string", description: "Category page title" },
|
|
3491
|
+
category: { type: "string", description: "Category name/slug" },
|
|
3492
|
+
lang: { type: "string", enum: [...LANG_ENUM2], description: "Language for the category page", default: "en" },
|
|
3493
|
+
country: { type: "string", enum: [...COUNTRY_ENUM2], description: "Target country for localization" },
|
|
3494
|
+
project_id: { type: "string", format: "uuid", description: "Project UUID" },
|
|
3495
|
+
persona_id: { type: "string", format: "uuid", description: "Persona UUID" },
|
|
3496
|
+
apply_project_brief_config: { type: "boolean", description: "Apply project configuration", default: false },
|
|
3497
|
+
use_faq: { type: "boolean", description: "Generate FAQ section", default: false },
|
|
3498
|
+
use_toc: { type: "boolean", description: "Generate table of contents", default: false },
|
|
3499
|
+
use_image: { type: "boolean", description: "Generate featured image", default: false },
|
|
3500
|
+
use_inlineimages: { type: "boolean", description: "Generate inline images", default: false },
|
|
3501
|
+
target_keyword: { type: "string", description: "Target SEO keyword" },
|
|
3502
|
+
keywords_secondary: { type: "string", description: "Secondary keywords (comma-separated)" },
|
|
3503
|
+
additional_information: { type: "string", description: "Additional context or instructions" },
|
|
3504
|
+
length: { description: 'Content length in words or "auto"', oneOf: [{ type: "number", maximum: 5e3 }, { type: "string", enum: ["auto"] }], default: "auto" },
|
|
3505
|
+
use_publishwordpress: { type: "boolean", description: "Publish to WordPress", default: false },
|
|
3506
|
+
publishwordpress_date: { type: "string", description: "Publication date (ISO 8601 or WordPress format)" },
|
|
3507
|
+
publishwordpress_status: { type: "string", enum: ["draft", "publish", "future"], description: "WordPress post status" },
|
|
3508
|
+
publishwordpress_category: { type: "number", description: "WordPress category ID" },
|
|
3509
|
+
publishwordpress_author: { type: "number", description: "WordPress author ID" },
|
|
3510
|
+
publishwordpress_connection: { type: "string", format: "uuid", description: "WordPress connection UUID" }
|
|
3504
3511
|
},
|
|
3505
|
-
required: ["name", "
|
|
3512
|
+
required: ["name", "subject"]
|
|
3506
3513
|
},
|
|
3507
3514
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
3508
3515
|
try {
|
|
@@ -3710,11 +3717,46 @@ var CategoryPagesToolHandler = class {
|
|
|
3710
3717
|
|
|
3711
3718
|
// src/handlers/tools/ProductPagesToolHandler.ts
|
|
3712
3719
|
import { z as z7 } from "zod";
|
|
3720
|
+
var boolField3 = z7.union([z7.boolean(), z7.string()]).transform(
|
|
3721
|
+
(val) => typeof val === "string" ? val === "true" : val
|
|
3722
|
+
).optional().default(false);
|
|
3723
|
+
var numField3 = z7.union([z7.number(), z7.string()]).transform(
|
|
3724
|
+
(val) => typeof val === "string" ? parseInt(val, 10) : val
|
|
3725
|
+
).optional();
|
|
3726
|
+
var LANG_ENUM3 = ["de", "en", "es", "fr", "it", "nl", "pl", "pt", "ro"];
|
|
3727
|
+
var COUNTRY_ENUM3 = ["ad", "ae", "ar", "at", "au", "be", "br", "ca", "ch", "cl", "co", "de", "eg", "es", "fr", "gb", "in", "it", "lu", "ma", "mx", "nl", "pe", "pl", "pt", "ro", "us", "za"];
|
|
3713
3728
|
var CreateProductPageSchema = z7.object({
|
|
3729
|
+
// Basic fields
|
|
3714
3730
|
name: z7.string().min(1, "Name is required"),
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3731
|
+
subject: z7.string().min(1, "Subject is required"),
|
|
3732
|
+
title: z7.string().optional(),
|
|
3733
|
+
product_name: z7.string().optional(),
|
|
3734
|
+
// Product-specific fields
|
|
3735
|
+
product_url: z7.string().url().optional(),
|
|
3736
|
+
product_description: z7.string().optional(),
|
|
3737
|
+
// Standard fields
|
|
3738
|
+
lang: z7.enum(LANG_ENUM3).optional().default("en"),
|
|
3739
|
+
country: z7.enum(COUNTRY_ENUM3).optional(),
|
|
3740
|
+
project_id: z7.string().uuid().optional(),
|
|
3741
|
+
persona_id: z7.string().uuid().optional(),
|
|
3742
|
+
apply_project_brief_config: boolField3,
|
|
3743
|
+
// SEO features
|
|
3744
|
+
use_faq: boolField3,
|
|
3745
|
+
use_toc: boolField3,
|
|
3746
|
+
use_image: boolField3,
|
|
3747
|
+
use_inlineimages: boolField3,
|
|
3748
|
+
// Additional fields that might be relevant
|
|
3749
|
+
target_keyword: z7.string().optional(),
|
|
3750
|
+
keywords_secondary: z7.string().optional(),
|
|
3751
|
+
additional_information: z7.string().optional(),
|
|
3752
|
+
length: z7.union([z7.number().max(5e3), z7.literal("auto")]).optional().default("auto"),
|
|
3753
|
+
// Publishing options
|
|
3754
|
+
use_publishwordpress: boolField3,
|
|
3755
|
+
publishwordpress_date: z7.string().optional(),
|
|
3756
|
+
publishwordpress_status: z7.enum(["draft", "publish", "future"]).optional(),
|
|
3757
|
+
publishwordpress_category: numField3,
|
|
3758
|
+
publishwordpress_author: numField3,
|
|
3759
|
+
publishwordpress_connection: z7.string().uuid().optional()
|
|
3718
3760
|
});
|
|
3719
3761
|
var ProductPagesToolHandler = class {
|
|
3720
3762
|
constructor(apiClient, cache, metrics) {
|
|
@@ -3744,10 +3786,33 @@ var ProductPagesToolHandler = class {
|
|
|
3744
3786
|
inputSchema: {
|
|
3745
3787
|
type: "object",
|
|
3746
3788
|
properties: {
|
|
3747
|
-
name: { type: "string", description: "Name of the product page", minLength: 1 },
|
|
3748
|
-
|
|
3789
|
+
name: { type: "string", description: "Name/identifier of the product page", minLength: 1 },
|
|
3790
|
+
subject: { type: "string", description: "Product subject/topic", minLength: 1 },
|
|
3791
|
+
title: { type: "string", description: "Product page title" },
|
|
3792
|
+
product_name: { type: "string", description: "Name of the product" },
|
|
3793
|
+
product_url: { type: "string", format: "uri", description: "URL of the product" },
|
|
3794
|
+
product_description: { type: "string", description: "Product description" },
|
|
3795
|
+
lang: { type: "string", enum: [...LANG_ENUM3], description: "Language for the product page", default: "en" },
|
|
3796
|
+
country: { type: "string", enum: [...COUNTRY_ENUM3], description: "Target country for localization" },
|
|
3797
|
+
project_id: { type: "string", format: "uuid", description: "Project UUID" },
|
|
3798
|
+
persona_id: { type: "string", format: "uuid", description: "Persona UUID" },
|
|
3799
|
+
apply_project_brief_config: { type: "boolean", description: "Apply project configuration", default: false },
|
|
3800
|
+
use_faq: { type: "boolean", description: "Generate FAQ section", default: false },
|
|
3801
|
+
use_toc: { type: "boolean", description: "Generate table of contents", default: false },
|
|
3802
|
+
use_image: { type: "boolean", description: "Generate featured image", default: false },
|
|
3803
|
+
use_inlineimages: { type: "boolean", description: "Generate inline images", default: false },
|
|
3804
|
+
target_keyword: { type: "string", description: "Target SEO keyword" },
|
|
3805
|
+
keywords_secondary: { type: "string", description: "Secondary keywords (comma-separated)" },
|
|
3806
|
+
additional_information: { type: "string", description: "Additional context or instructions" },
|
|
3807
|
+
length: { description: 'Content length in words or "auto"', oneOf: [{ type: "number", maximum: 5e3 }, { type: "string", enum: ["auto"] }], default: "auto" },
|
|
3808
|
+
use_publishwordpress: { type: "boolean", description: "Publish to WordPress", default: false },
|
|
3809
|
+
publishwordpress_date: { type: "string", description: "Publication date (ISO 8601 or WordPress format)" },
|
|
3810
|
+
publishwordpress_status: { type: "string", enum: ["draft", "publish", "future"], description: "WordPress post status" },
|
|
3811
|
+
publishwordpress_category: { type: "number", description: "WordPress category ID" },
|
|
3812
|
+
publishwordpress_author: { type: "number", description: "WordPress author ID" },
|
|
3813
|
+
publishwordpress_connection: { type: "string", format: "uuid", description: "WordPress connection UUID" }
|
|
3749
3814
|
},
|
|
3750
|
-
required: ["name", "
|
|
3815
|
+
required: ["name", "subject"]
|
|
3751
3816
|
},
|
|
3752
3817
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
3753
3818
|
try {
|
|
@@ -3936,7 +4001,7 @@ var ProductPagesToolHandler = class {
|
|
|
3936
4001
|
|
|
3937
4002
|
// src/handlers/tools/DiscoverToolHandler.ts
|
|
3938
4003
|
import { z as z8 } from "zod";
|
|
3939
|
-
var
|
|
4004
|
+
var boolField4 = z8.union([z8.boolean(), z8.string()]).transform(
|
|
3940
4005
|
(val) => typeof val === "string" ? val === "true" : val
|
|
3941
4006
|
).optional().default(false);
|
|
3942
4007
|
var DiscoverContentSchema = z8.object({
|
|
@@ -3945,7 +4010,7 @@ var DiscoverContentSchema = z8.object({
|
|
|
3945
4010
|
keywords_secondary: z8.string().optional(),
|
|
3946
4011
|
project_id: z8.string().uuid().optional(),
|
|
3947
4012
|
persona_id: z8.string().uuid().optional(),
|
|
3948
|
-
apply_project_brief_config:
|
|
4013
|
+
apply_project_brief_config: boolField4,
|
|
3949
4014
|
lang: z8.enum(["fr", "en"]).optional(),
|
|
3950
4015
|
country: z8.enum(["fr", "be", "ch", "ca", "us", "gb"]).optional(),
|
|
3951
4016
|
length: z8.union([z8.number().max(2e3), z8.literal("auto")]).optional(),
|
|
@@ -4102,28 +4167,12 @@ var DiscoverToolHandler = class {
|
|
|
4102
4167
|
},
|
|
4103
4168
|
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4104
4169
|
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("");
|
|
4113
4170
|
logger.info("discover_content RAW INPUT", {
|
|
4114
4171
|
raw_args: args,
|
|
4115
4172
|
apply_project_brief_config_raw: args.apply_project_brief_config,
|
|
4116
4173
|
apply_project_brief_config_raw_type: typeof args.apply_project_brief_config
|
|
4117
4174
|
});
|
|
4118
4175
|
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("");
|
|
4127
4176
|
logger.info("discover_content VALIDATED (after boolField transform)", {
|
|
4128
4177
|
apply_project_brief_config: validated.apply_project_brief_config,
|
|
4129
4178
|
apply_project_brief_config_type: typeof validated.apply_project_brief_config,
|
|
@@ -4136,13 +4185,6 @@ var DiscoverToolHandler = class {
|
|
|
4136
4185
|
cleanedInput[key] = value;
|
|
4137
4186
|
}
|
|
4138
4187
|
}
|
|
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("");
|
|
4146
4188
|
logger.info("discover_content CLEANED INPUT (undefined removed)", {
|
|
4147
4189
|
before_cleaning_keys: Object.keys(validated).length,
|
|
4148
4190
|
after_cleaning_keys: Object.keys(cleanedInput).length,
|
|
@@ -4150,11 +4192,6 @@ var DiscoverToolHandler = class {
|
|
|
4150
4192
|
apply_project_brief_config_value: cleanedInput.apply_project_brief_config
|
|
4151
4193
|
});
|
|
4152
4194
|
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("");
|
|
4158
4195
|
await this.cache.set(`discover:${discovery.id}`, discovery, 300);
|
|
4159
4196
|
this.metrics.recordAPICall("discover_content", "success");
|
|
4160
4197
|
return {
|
|
@@ -4164,15 +4201,6 @@ var DiscoverToolHandler = class {
|
|
|
4164
4201
|
success: true,
|
|
4165
4202
|
discovery_id: discovery.id,
|
|
4166
4203
|
message: "Content discovery created successfully",
|
|
4167
|
-
// DIAGNOSTIC INFORMATION - shows what MCP received and validated
|
|
4168
|
-
debug_info: {
|
|
4169
|
-
raw_input_has_param: "apply_project_brief_config" in args,
|
|
4170
|
-
raw_input_value: args.apply_project_brief_config,
|
|
4171
|
-
raw_input_type: typeof args.apply_project_brief_config,
|
|
4172
|
-
validated_has_param: "apply_project_brief_config" in validated,
|
|
4173
|
-
validated_value: validated.apply_project_brief_config,
|
|
4174
|
-
validated_type: typeof validated.apply_project_brief_config
|
|
4175
|
-
},
|
|
4176
4204
|
next_steps: [
|
|
4177
4205
|
`Use 'run_discovery' with id: ${discovery.id}`,
|
|
4178
4206
|
`Use 'get_discover_result' with id: ${discovery.id}`
|
|
@@ -4573,198 +4601,6 @@ var RSSToolHandler = class {
|
|
|
4573
4601
|
}
|
|
4574
4602
|
};
|
|
4575
4603
|
|
|
4576
|
-
// src/handlers/tools/UpdatePostsToolHandler.ts
|
|
4577
|
-
var UpdatePostsToolHandler = class {
|
|
4578
|
-
constructor(apiClient, cache, metrics) {
|
|
4579
|
-
this.apiClient = apiClient;
|
|
4580
|
-
this.cache = cache;
|
|
4581
|
-
this.metrics = metrics;
|
|
4582
|
-
}
|
|
4583
|
-
static {
|
|
4584
|
-
__name(this, "UpdatePostsToolHandler");
|
|
4585
|
-
}
|
|
4586
|
-
getTools() {
|
|
4587
|
-
return [
|
|
4588
|
-
this.createUpdatePostTool(),
|
|
4589
|
-
this.getUpdatePostTool(),
|
|
4590
|
-
this.listUpdatePostsTool(),
|
|
4591
|
-
this.updateUpdatePostTool(),
|
|
4592
|
-
this.runUpdatePostTool(),
|
|
4593
|
-
this.getUpdatePostOutputTool(),
|
|
4594
|
-
this.estimateUpdatePostCostTool(),
|
|
4595
|
-
this.bulkCreateUpdatePostsTool()
|
|
4596
|
-
];
|
|
4597
|
-
}
|
|
4598
|
-
createUpdatePostTool() {
|
|
4599
|
-
return {
|
|
4600
|
-
name: "create_update_post",
|
|
4601
|
-
description: "Create a new update post for refreshing existing content",
|
|
4602
|
-
inputSchema: {
|
|
4603
|
-
type: "object",
|
|
4604
|
-
properties: {
|
|
4605
|
-
data: { type: "object", description: "Update post configuration", properties: { input: { type: "object", description: "Update post input configuration" } }, required: ["input"] }
|
|
4606
|
-
},
|
|
4607
|
-
required: ["data"]
|
|
4608
|
-
},
|
|
4609
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4610
|
-
try {
|
|
4611
|
-
const updatePost = await this.apiClient.createUpdatePost(args);
|
|
4612
|
-
await this.cache.set(`update_post:${updatePost.id}`, updatePost, 300);
|
|
4613
|
-
this.metrics.recordAPICall("create_update_post", "success");
|
|
4614
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post_id: updatePost.id, message: "Update post created successfully", next_steps: [`Use 'run_update_post' with id: ${updatePost.id}`, `Use 'get_update_post' with id: ${updatePost.id}`] }, null, 2) }] };
|
|
4615
|
-
} catch (error) {
|
|
4616
|
-
logger.error("Failed to create update post", { error: error.message });
|
|
4617
|
-
this.metrics.recordAPICall("create_update_post", "error");
|
|
4618
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to create update post" }, null, 2) }], isError: true };
|
|
4619
|
-
}
|
|
4620
|
-
}, "handler")
|
|
4621
|
-
};
|
|
4622
|
-
}
|
|
4623
|
-
getUpdatePostTool() {
|
|
4624
|
-
return {
|
|
4625
|
-
name: "get_update_post",
|
|
4626
|
-
description: "Get update post details and status",
|
|
4627
|
-
inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
|
|
4628
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4629
|
-
try {
|
|
4630
|
-
const { id } = args;
|
|
4631
|
-
const cached = await this.cache.get(`update_post:${id}`);
|
|
4632
|
-
if (cached) {
|
|
4633
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post: cached, from_cache: true }, null, 2) }] };
|
|
4634
|
-
}
|
|
4635
|
-
const updatePost = await this.apiClient.getUpdatePost(id);
|
|
4636
|
-
await this.cache.set(`update_post:${id}`, updatePost, 300);
|
|
4637
|
-
this.metrics.recordAPICall("get_update_post", "success");
|
|
4638
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post: updatePost }, null, 2) }] };
|
|
4639
|
-
} catch (error) {
|
|
4640
|
-
logger.error("Failed to get update post", { error: error.message });
|
|
4641
|
-
this.metrics.recordAPICall("get_update_post", "error");
|
|
4642
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to get update post" }, null, 2) }], isError: true };
|
|
4643
|
-
}
|
|
4644
|
-
}, "handler")
|
|
4645
|
-
};
|
|
4646
|
-
}
|
|
4647
|
-
listUpdatePostsTool() {
|
|
4648
|
-
return {
|
|
4649
|
-
name: "list_update_posts",
|
|
4650
|
-
description: "List all update posts",
|
|
4651
|
-
inputSchema: { type: "object", properties: { skip: { type: "number", default: 0 }, take: { type: "number", default: 10 }, search: { type: "string" }, status: { type: "string" }, project_id: { type: "string", format: "uuid" } } },
|
|
4652
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4653
|
-
try {
|
|
4654
|
-
const result2 = await this.apiClient.listUpdatePosts(args);
|
|
4655
|
-
this.metrics.recordAPICall("list_update_posts", "success");
|
|
4656
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, total: result2.total, count: result2.items.length, update_posts: result2.items.map((u) => ({ id: u.id, name: u.name, status: u.status, created_at: u.created_at })) }, null, 2) }] };
|
|
4657
|
-
} catch (error) {
|
|
4658
|
-
logger.error("Failed to list update posts", { error: error.message });
|
|
4659
|
-
this.metrics.recordAPICall("list_update_posts", "error");
|
|
4660
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to list update posts" }, null, 2) }], isError: true };
|
|
4661
|
-
}
|
|
4662
|
-
}, "handler")
|
|
4663
|
-
};
|
|
4664
|
-
}
|
|
4665
|
-
updateUpdatePostTool() {
|
|
4666
|
-
return {
|
|
4667
|
-
name: "update_update_post",
|
|
4668
|
-
description: "Update an existing update post",
|
|
4669
|
-
inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" }, updates: { type: "object", description: "Fields to update" } }, required: ["id", "updates"] },
|
|
4670
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4671
|
-
try {
|
|
4672
|
-
const { id, updates } = args;
|
|
4673
|
-
await this.apiClient.updateUpdatePost(id, updates);
|
|
4674
|
-
await this.cache.delete(`update_post:${id}`);
|
|
4675
|
-
this.metrics.recordAPICall("update_update_post", "success");
|
|
4676
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, message: "Update post updated successfully", id, updated_fields: Object.keys(updates) }, null, 2) }] };
|
|
4677
|
-
} catch (error) {
|
|
4678
|
-
logger.error("Failed to update update post", { error: error.message });
|
|
4679
|
-
this.metrics.recordAPICall("update_update_post", "error");
|
|
4680
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to update update post" }, null, 2) }], isError: true };
|
|
4681
|
-
}
|
|
4682
|
-
}, "handler")
|
|
4683
|
-
};
|
|
4684
|
-
}
|
|
4685
|
-
runUpdatePostTool() {
|
|
4686
|
-
return {
|
|
4687
|
-
name: "run_update_post",
|
|
4688
|
-
description: "Run generation for an update post",
|
|
4689
|
-
inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
|
|
4690
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4691
|
-
try {
|
|
4692
|
-
const { id } = args;
|
|
4693
|
-
await this.apiClient.runUpdatePost(id);
|
|
4694
|
-
await this.cache.delete(`update_post:${id}`);
|
|
4695
|
-
this.metrics.recordAPICall("run_update_post", "success");
|
|
4696
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, message: "Update post generation started", update_post_id: id, next_step: `Use 'get_update_post' or 'get_update_post_output' to check status` }, null, 2) }] };
|
|
4697
|
-
} catch (error) {
|
|
4698
|
-
logger.error("Failed to run update post", { error: error.message });
|
|
4699
|
-
this.metrics.recordAPICall("run_update_post", "error");
|
|
4700
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to run update post" }, null, 2) }], isError: true };
|
|
4701
|
-
}
|
|
4702
|
-
}, "handler")
|
|
4703
|
-
};
|
|
4704
|
-
}
|
|
4705
|
-
getUpdatePostOutputTool() {
|
|
4706
|
-
return {
|
|
4707
|
-
name: "get_update_post_output",
|
|
4708
|
-
description: "Get the generated output of an update post",
|
|
4709
|
-
inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
|
|
4710
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4711
|
-
try {
|
|
4712
|
-
const { id } = args;
|
|
4713
|
-
const cacheKey = `update_post:output:${id}`;
|
|
4714
|
-
const cached = await this.cache.get(cacheKey);
|
|
4715
|
-
const output = cached || await this.apiClient.getUpdatePostOutput(id);
|
|
4716
|
-
if (!cached && output) {
|
|
4717
|
-
await this.cache.set(cacheKey, output, 600);
|
|
4718
|
-
}
|
|
4719
|
-
this.metrics.recordAPICall("get_update_post_output", "success");
|
|
4720
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post_id: id, output, from_cache: !!cached }, null, 2) }] };
|
|
4721
|
-
} catch (error) {
|
|
4722
|
-
logger.error("Failed to get update post output", { error: error.message });
|
|
4723
|
-
this.metrics.recordAPICall("get_update_post_output", "error");
|
|
4724
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to get update post output" }, null, 2) }], isError: true };
|
|
4725
|
-
}
|
|
4726
|
-
}, "handler")
|
|
4727
|
-
};
|
|
4728
|
-
}
|
|
4729
|
-
estimateUpdatePostCostTool() {
|
|
4730
|
-
return {
|
|
4731
|
-
name: "estimate_update_post_cost",
|
|
4732
|
-
description: "Estimate the cost of an update post",
|
|
4733
|
-
inputSchema: { type: "object", properties: { data: { type: "object", description: "Update post configuration for cost estimation" } }, required: ["data"] },
|
|
4734
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4735
|
-
try {
|
|
4736
|
-
const cost = await this.apiClient.calculateUpdatePostCost(args);
|
|
4737
|
-
this.metrics.recordAPICall("estimate_update_post_cost", "success");
|
|
4738
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, cost_estimate: cost }, null, 2) }] };
|
|
4739
|
-
} catch (error) {
|
|
4740
|
-
logger.error("Failed to estimate update post cost", { error: error.message });
|
|
4741
|
-
this.metrics.recordAPICall("estimate_update_post_cost", "error");
|
|
4742
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to estimate cost" }, null, 2) }], isError: true };
|
|
4743
|
-
}
|
|
4744
|
-
}, "handler")
|
|
4745
|
-
};
|
|
4746
|
-
}
|
|
4747
|
-
bulkCreateUpdatePostsTool() {
|
|
4748
|
-
return {
|
|
4749
|
-
name: "bulk_create_update_posts",
|
|
4750
|
-
description: "Create multiple update posts at once",
|
|
4751
|
-
inputSchema: { type: "object", properties: { items: { type: "array", items: { type: "object" } } }, required: ["items"] },
|
|
4752
|
-
handler: /* @__PURE__ */ __name(async (args) => {
|
|
4753
|
-
try {
|
|
4754
|
-
const { items } = args;
|
|
4755
|
-
const result2 = await this.apiClient.createBulkUpdatePosts(items);
|
|
4756
|
-
this.metrics.recordAPICall("bulk_create_update_posts", "success");
|
|
4757
|
-
return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Bulk created ${items.length} update posts`, result: result2 }, null, 2) }] };
|
|
4758
|
-
} catch (error) {
|
|
4759
|
-
logger.error("Failed to bulk create update posts", { error: error.message });
|
|
4760
|
-
this.metrics.recordAPICall("bulk_create_update_posts", "error");
|
|
4761
|
-
return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to bulk create update posts" }, null, 2) }], isError: true };
|
|
4762
|
-
}
|
|
4763
|
-
}, "handler")
|
|
4764
|
-
};
|
|
4765
|
-
}
|
|
4766
|
-
};
|
|
4767
|
-
|
|
4768
4604
|
// src/handlers/tools/TransactionsToolHandler.ts
|
|
4769
4605
|
var TransactionsToolHandler = class {
|
|
4770
4606
|
constructor(apiClient, _cache, metrics) {
|
|
@@ -5072,7 +4908,7 @@ var ResourceHandler = class {
|
|
|
5072
4908
|
},
|
|
5073
4909
|
type: {
|
|
5074
4910
|
type: "string",
|
|
5075
|
-
enum: ["blog", "
|
|
4911
|
+
enum: ["blog", "affiliation-product-review", "affiliation-compare-products", "affiliation-top-product"],
|
|
5076
4912
|
default: "blog"
|
|
5077
4913
|
},
|
|
5078
4914
|
lang: {
|
|
@@ -5921,19 +5757,19 @@ Here are 5 powerful workflows that Wisewand users love:
|
|
|
5921
5757
|
|
|
5922
5758
|
### \u{1F4E1} Workflow 4: RSS-Powered Auto-Publishing
|
|
5923
5759
|
|
|
5924
|
-
**Goal:** Curate industry
|
|
5760
|
+
**Goal:** Curate industry content automatically
|
|
5925
5761
|
|
|
5926
5762
|
\`\`\`
|
|
5927
|
-
1. create_rss_connection with industry
|
|
5763
|
+
1. create_rss_connection with industry feeds
|
|
5928
5764
|
2. create_rss_article_from_feed:
|
|
5929
5765
|
- Monitors RSS feeds
|
|
5930
5766
|
- Generates original commentary/analysis
|
|
5931
5767
|
- Adds your expert perspective
|
|
5932
5768
|
3. Set up recurring jobs (via Jobs tools)
|
|
5933
|
-
4. Auto-publish
|
|
5769
|
+
4. Auto-publish blog posts to WordPress
|
|
5934
5770
|
\`\`\`
|
|
5935
5771
|
|
|
5936
|
-
**Perfect for:**
|
|
5772
|
+
**Perfect for:** Content curation, industry newsletters, trend analysis blogs
|
|
5937
5773
|
|
|
5938
5774
|
---
|
|
5939
5775
|
|
|
@@ -6039,7 +5875,7 @@ Use \`get_transactions\` to track:
|
|
|
6039
5875
|
|
|
6040
5876
|
**11. Smart Image Usage**
|
|
6041
5877
|
- AI images cost credits
|
|
6042
|
-
- Skip images for
|
|
5878
|
+
- Skip images for quick updates: \`use_image: false\`
|
|
6043
5879
|
- Use images for evergreen content: \`use_image: true\`
|
|
6044
5880
|
- Best ratios: 16:9 (blog), 1:1 (social), 9:16 (mobile)
|
|
6045
5881
|
|
|
@@ -6229,7 +6065,6 @@ var WisewandMCPServer = class {
|
|
|
6229
6065
|
this.productPagesHandler = new ProductPagesToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6230
6066
|
this.discoverHandler = new DiscoverToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6231
6067
|
this.rssHandler = new RSSToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6232
|
-
this.updatePostsHandler = new UpdatePostsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6233
6068
|
this.transactionsHandler = new TransactionsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6234
6069
|
this.jobsHandler = new JobsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6235
6070
|
this.resourceHandler = new ResourceHandler(this.apiClient, this.cacheManager);
|
|
@@ -6262,7 +6097,6 @@ var WisewandMCPServer = class {
|
|
|
6262
6097
|
productPagesHandler;
|
|
6263
6098
|
discoverHandler;
|
|
6264
6099
|
rssHandler;
|
|
6265
|
-
updatePostsHandler;
|
|
6266
6100
|
transactionsHandler;
|
|
6267
6101
|
jobsHandler;
|
|
6268
6102
|
resourceHandler;
|
|
@@ -6280,7 +6114,6 @@ var WisewandMCPServer = class {
|
|
|
6280
6114
|
...this.productPagesHandler.getTools(),
|
|
6281
6115
|
...this.discoverHandler.getTools(),
|
|
6282
6116
|
...this.rssHandler.getTools(),
|
|
6283
|
-
...this.updatePostsHandler.getTools(),
|
|
6284
6117
|
...this.transactionsHandler.getTools(),
|
|
6285
6118
|
...this.jobsHandler.getTools()
|
|
6286
6119
|
];
|