@wisewandtools/mcp-server 2.1.0 → 2.1.1

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
@@ -2777,15 +2777,27 @@ var BulkOperationsToolHandler = class {
2777
2777
  }
2778
2778
  }
2779
2779
  const { articles, auto_generate = false } = processedArgs;
2780
- logger.info("BULK CREATE DEBUG - Handler received:", {
2781
- articles_type: typeof articles,
2782
- is_array: Array.isArray(articles),
2783
- articles_length: Array.isArray(articles) ? articles.length : "N/A",
2784
- first_article: Array.isArray(articles) && articles.length > 0 ? articles[0] : null,
2780
+ logger.info("Validating and transforming article data types", { count: articles.length });
2781
+ const validatedArticles = articles.map((article, index) => {
2782
+ try {
2783
+ const validated = CreateArticleSchema.parse(article);
2784
+ return validated;
2785
+ } catch (error) {
2786
+ logger.error(`Validation failed for article ${index}:`, {
2787
+ article,
2788
+ error: error.message
2789
+ });
2790
+ throw new Error(`Article ${index} validation failed: ${error.message}`);
2791
+ }
2792
+ });
2793
+ logger.info("BULK CREATE DEBUG - After validation:", {
2794
+ original_count: articles.length,
2795
+ validated_count: validatedArticles.length,
2796
+ first_validated: validatedArticles.length > 0 ? validatedArticles[0] : null,
2785
2797
  auto_generate
2786
2798
  });
2787
- logger.info("Starting bulk article creation", { count: articles.length });
2788
- const createResult = await this.apiClient.createBulkArticles(articles);
2799
+ logger.info("Starting bulk article creation", { count: validatedArticles.length });
2800
+ const createResult = await this.apiClient.createBulkArticles(validatedArticles);
2789
2801
  const results = {
2790
2802
  total: articles.length,
2791
2803
  created: createResult.items.length,