@wisewandtools/mcp-server 2.0.19 → 2.1.0

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
@@ -2767,12 +2767,20 @@ var BulkOperationsToolHandler = class {
2767
2767
  },
2768
2768
  handler: /* @__PURE__ */ __name(async (args) => {
2769
2769
  try {
2770
- const { articles, auto_generate = false } = args;
2770
+ let processedArgs = { ...args };
2771
+ if (typeof args.articles === "string") {
2772
+ logger.info("Converting articles from string to array");
2773
+ try {
2774
+ processedArgs.articles = JSON.parse(args.articles);
2775
+ } catch (error) {
2776
+ throw new Error("Invalid articles format: expected array or JSON string");
2777
+ }
2778
+ }
2779
+ const { articles, auto_generate = false } = processedArgs;
2771
2780
  logger.info("BULK CREATE DEBUG - Handler received:", {
2772
2781
  articles_type: typeof articles,
2773
2782
  is_array: Array.isArray(articles),
2774
2783
  articles_length: Array.isArray(articles) ? articles.length : "N/A",
2775
- articles_stringified: typeof articles === "string",
2776
2784
  first_article: Array.isArray(articles) && articles.length > 0 ? articles[0] : null,
2777
2785
  auto_generate
2778
2786
  });
@@ -2870,7 +2878,16 @@ var BulkOperationsToolHandler = class {
2870
2878
  },
2871
2879
  handler: /* @__PURE__ */ __name(async (args) => {
2872
2880
  try {
2873
- const { articles } = args;
2881
+ let processedArgs = { ...args };
2882
+ if (typeof args.articles === "string") {
2883
+ logger.info("Converting articles from string to array (bulk cost estimate)");
2884
+ try {
2885
+ processedArgs.articles = JSON.parse(args.articles);
2886
+ } catch (error) {
2887
+ throw new Error("Invalid articles format: expected array or JSON string");
2888
+ }
2889
+ }
2890
+ const { articles } = processedArgs;
2874
2891
  const result2 = await this.apiClient.calculateBulkCost(articles);
2875
2892
  this.metrics.recordAPICall("bulk_estimate_cost", "success");
2876
2893
  return {