@contentful/mcp-tools 0.8.0 → 0.12.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
@@ -2346,7 +2346,7 @@ var MCP_INSTRUCTIONS = `You are a helpful assistant integrated with Contentful t
2346
2346
  ## Entry Management:
2347
2347
  - For entry creation, use create_entry with clear instructions
2348
2348
  - Use entry_action for operations like publishing, unpublishing, deleting, or discarding entries
2349
- - Use update_entry for content modifications with AI assistance
2349
+ - Use update_entry for content modifications with AI assistance. Always call get_entry first and pass the returned sys.version to update_entry; this is required and prevents overwriting concurrent changes.
2350
2350
  - Use patch_entry for precise, direct modifications without AI generation (one operation at a time)
2351
2351
  - Use transform_entry when preserving rich text formatting is crucial
2352
2352
  - Use translate_entry specifically for language translation tasks
@@ -2724,111 +2724,147 @@ function searchEntriesTool(config) {
2724
2724
  return withErrorHandling(tool2, "Error searching entries");
2725
2725
  }
2726
2726
 
2727
+ // src/tools/entries/semanticSearch.ts
2728
+ import { z as z39 } from "zod";
2729
+ var SemanticSearchToolParams = BaseToolSchema.extend({
2730
+ query: z39.string().describe(
2731
+ "Natural-language description of what you are looking for. Phrases that resemble the content of the entries you want match best \u2014 avoid questions or JSON."
2732
+ ),
2733
+ contentTypeIds: z39.array(z39.string()).min(1).optional().describe("Restrict the search to entries of these content type IDs")
2734
+ });
2735
+ function semanticSearchTool(config) {
2736
+ async function tool2(args) {
2737
+ const contentfulClient = createToolClient(config, args);
2738
+ const filter = args.contentTypeIds && args.contentTypeIds.length > 0 ? { entityType: "Entry", contentTypeIds: args.contentTypeIds } : void 0;
2739
+ const results = await contentfulClient.semanticSearch.get(
2740
+ {
2741
+ spaceId: args.spaceId,
2742
+ environmentId: args.environmentId
2743
+ },
2744
+ {
2745
+ query: args.query,
2746
+ ...filter ? { filter } : {}
2747
+ }
2748
+ );
2749
+ const entries = results.items.map((item) => ({
2750
+ id: item.sys.entity.sys.id
2751
+ }));
2752
+ return createSuccessResponse(
2753
+ "Semantic search results retrieved successfully",
2754
+ {
2755
+ entries,
2756
+ ...results.sys.correlationId !== void 0 ? { correlationId: results.sys.correlationId } : {}
2757
+ }
2758
+ );
2759
+ }
2760
+ return withErrorHandling(tool2, "Error performing semantic search");
2761
+ }
2762
+
2727
2763
  // src/tools/entries/createEntry.ts
2728
- import { z as z41 } from "zod";
2764
+ import { z as z42 } from "zod";
2729
2765
 
2730
2766
  // src/types/entryFieldSchema.ts
2731
- import { z as z40 } from "zod";
2767
+ import { z as z41 } from "zod";
2732
2768
 
2733
2769
  // src/types/richTextSchema.ts
2734
2770
  import { BLOCKS as BLOCKS2, INLINES as INLINES2, MARKS } from "@contentful/rich-text-types";
2735
- import { z as z39 } from "zod";
2736
- var emptyNodeDataSchema = z39.object({});
2737
- var entryLinkTargetSchema = z39.object({
2738
- sys: z39.object({
2739
- id: z39.string(),
2740
- type: z39.literal("Link"),
2741
- linkType: z39.literal("Entry")
2771
+ import { z as z40 } from "zod";
2772
+ var emptyNodeDataSchema = z40.object({});
2773
+ var entryLinkTargetSchema = z40.object({
2774
+ sys: z40.object({
2775
+ id: z40.string(),
2776
+ type: z40.literal("Link"),
2777
+ linkType: z40.literal("Entry")
2742
2778
  })
2743
2779
  });
2744
- var assetLinkTargetSchema = z39.object({
2745
- sys: z39.object({
2746
- id: z39.string(),
2747
- type: z39.literal("Link"),
2748
- linkType: z39.literal("Asset")
2780
+ var assetLinkTargetSchema = z40.object({
2781
+ sys: z40.object({
2782
+ id: z40.string(),
2783
+ type: z40.literal("Link"),
2784
+ linkType: z40.literal("Asset")
2749
2785
  })
2750
2786
  });
2751
- var resourceLinkTargetSchema = z39.object({
2752
- sys: z39.object({
2753
- type: z39.literal("ResourceLink"),
2754
- linkType: z39.string(),
2755
- urn: z39.string()
2787
+ var resourceLinkTargetSchema = z40.object({
2788
+ sys: z40.object({
2789
+ type: z40.literal("ResourceLink"),
2790
+ linkType: z40.string(),
2791
+ urn: z40.string()
2756
2792
  })
2757
2793
  });
2758
- var richTextMarkSchema = z39.object({
2759
- type: z39.nativeEnum(MARKS)
2794
+ var richTextMarkSchema = z40.object({
2795
+ type: z40.nativeEnum(MARKS)
2760
2796
  });
2761
- var richTextTextNodeSchema = z39.object({
2762
- nodeType: z39.literal("text"),
2763
- value: z39.string(),
2764
- marks: z39.array(richTextMarkSchema),
2797
+ var richTextTextNodeSchema = z40.object({
2798
+ nodeType: z40.literal("text"),
2799
+ value: z40.string(),
2800
+ marks: z40.array(richTextMarkSchema),
2765
2801
  data: emptyNodeDataSchema
2766
2802
  });
2767
- var embeddedEntryBlockNodeSchema = z39.object({
2768
- nodeType: z39.literal(BLOCKS2.EMBEDDED_ENTRY),
2769
- data: z39.object({
2803
+ var embeddedEntryBlockNodeSchema = z40.object({
2804
+ nodeType: z40.literal(BLOCKS2.EMBEDDED_ENTRY),
2805
+ data: z40.object({
2770
2806
  target: entryLinkTargetSchema
2771
2807
  }),
2772
- content: z39.array(z39.never())
2808
+ content: z40.array(z40.never())
2773
2809
  });
2774
- var embeddedEntryInlineNodeSchema = z39.object({
2775
- nodeType: z39.literal(INLINES2.EMBEDDED_ENTRY),
2776
- data: z39.object({
2810
+ var embeddedEntryInlineNodeSchema = z40.object({
2811
+ nodeType: z40.literal(INLINES2.EMBEDDED_ENTRY),
2812
+ data: z40.object({
2777
2813
  target: entryLinkTargetSchema
2778
2814
  }),
2779
- content: z39.array(z39.never())
2815
+ content: z40.array(z40.never())
2780
2816
  });
2781
- var embeddedAssetBlockNodeSchema = z39.object({
2782
- nodeType: z39.literal(BLOCKS2.EMBEDDED_ASSET),
2783
- data: z39.object({
2817
+ var embeddedAssetBlockNodeSchema = z40.object({
2818
+ nodeType: z40.literal(BLOCKS2.EMBEDDED_ASSET),
2819
+ data: z40.object({
2784
2820
  target: assetLinkTargetSchema
2785
2821
  }),
2786
- content: z39.array(z39.never())
2822
+ content: z40.array(z40.never())
2787
2823
  });
2788
- var hyperlinkInlineNodeSchema = z39.object({
2789
- nodeType: z39.literal(INLINES2.HYPERLINK),
2790
- data: z39.object({
2791
- uri: z39.string().url()
2824
+ var hyperlinkInlineNodeSchema = z40.object({
2825
+ nodeType: z40.literal(INLINES2.HYPERLINK),
2826
+ data: z40.object({
2827
+ uri: z40.string().url()
2792
2828
  }),
2793
- content: z39.array(richTextTextNodeSchema)
2829
+ content: z40.array(richTextTextNodeSchema)
2794
2830
  });
2795
- var entryHyperlinkInlineNodeSchema = z39.object({
2796
- nodeType: z39.literal(INLINES2.ENTRY_HYPERLINK),
2797
- data: z39.object({
2831
+ var entryHyperlinkInlineNodeSchema = z40.object({
2832
+ nodeType: z40.literal(INLINES2.ENTRY_HYPERLINK),
2833
+ data: z40.object({
2798
2834
  target: entryLinkTargetSchema
2799
2835
  }),
2800
- content: z39.array(richTextTextNodeSchema)
2836
+ content: z40.array(richTextTextNodeSchema)
2801
2837
  });
2802
- var assetHyperlinkInlineNodeSchema = z39.object({
2803
- nodeType: z39.literal(INLINES2.ASSET_HYPERLINK),
2804
- data: z39.object({
2838
+ var assetHyperlinkInlineNodeSchema = z40.object({
2839
+ nodeType: z40.literal(INLINES2.ASSET_HYPERLINK),
2840
+ data: z40.object({
2805
2841
  target: assetLinkTargetSchema
2806
2842
  }),
2807
- content: z39.array(richTextTextNodeSchema)
2843
+ content: z40.array(richTextTextNodeSchema)
2808
2844
  });
2809
- var embeddedResourceBlockNodeSchema = z39.object({
2810
- nodeType: z39.literal(BLOCKS2.EMBEDDED_RESOURCE),
2811
- data: z39.object({
2845
+ var embeddedResourceBlockNodeSchema = z40.object({
2846
+ nodeType: z40.literal(BLOCKS2.EMBEDDED_RESOURCE),
2847
+ data: z40.object({
2812
2848
  target: resourceLinkTargetSchema
2813
2849
  }),
2814
- content: z39.array(z39.never())
2850
+ content: z40.array(z40.never())
2815
2851
  });
2816
- var embeddedResourceInlineNodeSchema = z39.object({
2817
- nodeType: z39.literal(INLINES2.EMBEDDED_RESOURCE),
2818
- data: z39.object({
2852
+ var embeddedResourceInlineNodeSchema = z40.object({
2853
+ nodeType: z40.literal(INLINES2.EMBEDDED_RESOURCE),
2854
+ data: z40.object({
2819
2855
  target: resourceLinkTargetSchema
2820
2856
  }),
2821
- content: z39.array(z39.never())
2857
+ content: z40.array(z40.never())
2822
2858
  });
2823
- var resourceHyperlinkInlineNodeSchema = z39.object({
2824
- nodeType: z39.literal(INLINES2.RESOURCE_HYPERLINK),
2825
- data: z39.object({
2859
+ var resourceHyperlinkInlineNodeSchema = z40.object({
2860
+ nodeType: z40.literal(INLINES2.RESOURCE_HYPERLINK),
2861
+ data: z40.object({
2826
2862
  target: resourceLinkTargetSchema
2827
2863
  }),
2828
- content: z39.array(richTextTextNodeSchema)
2864
+ content: z40.array(richTextTextNodeSchema)
2829
2865
  });
2830
- var richTextInlineNodeSchema = z39.lazy(
2831
- () => z39.union([
2866
+ var richTextInlineNodeSchema = z40.lazy(
2867
+ () => z40.union([
2832
2868
  richTextTextNodeSchema,
2833
2869
  embeddedEntryInlineNodeSchema,
2834
2870
  hyperlinkInlineNodeSchema,
@@ -2838,17 +2874,17 @@ var richTextInlineNodeSchema = z39.lazy(
2838
2874
  resourceHyperlinkInlineNodeSchema
2839
2875
  ])
2840
2876
  );
2841
- var paragraphNodeSchema = z39.lazy(
2842
- () => z39.object({
2843
- nodeType: z39.literal(BLOCKS2.PARAGRAPH),
2877
+ var paragraphNodeSchema = z40.lazy(
2878
+ () => z40.object({
2879
+ nodeType: z40.literal(BLOCKS2.PARAGRAPH),
2844
2880
  data: emptyNodeDataSchema,
2845
- content: z39.array(richTextInlineNodeSchema)
2881
+ content: z40.array(richTextInlineNodeSchema)
2846
2882
  })
2847
2883
  );
2848
- var headingNodeSchema = (headingNodeType) => z39.object({
2849
- nodeType: z39.literal(headingNodeType),
2884
+ var headingNodeSchema = (headingNodeType) => z40.object({
2885
+ nodeType: z40.literal(headingNodeType),
2850
2886
  data: emptyNodeDataSchema,
2851
- content: z39.array(richTextInlineNodeSchema)
2887
+ content: z40.array(richTextInlineNodeSchema)
2852
2888
  });
2853
2889
  var heading1NodeSchema = headingNodeSchema(BLOCKS2.HEADING_1);
2854
2890
  var heading2NodeSchema = headingNodeSchema(BLOCKS2.HEADING_2);
@@ -2856,56 +2892,56 @@ var heading3NodeSchema = headingNodeSchema(BLOCKS2.HEADING_3);
2856
2892
  var heading4NodeSchema = headingNodeSchema(BLOCKS2.HEADING_4);
2857
2893
  var heading5NodeSchema = headingNodeSchema(BLOCKS2.HEADING_5);
2858
2894
  var heading6NodeSchema = headingNodeSchema(BLOCKS2.HEADING_6);
2859
- var hrNodeSchema = z39.object({
2860
- nodeType: z39.literal(BLOCKS2.HR),
2895
+ var hrNodeSchema = z40.object({
2896
+ nodeType: z40.literal(BLOCKS2.HR),
2861
2897
  data: emptyNodeDataSchema,
2862
- content: z39.array(z39.never())
2898
+ content: z40.array(z40.never())
2863
2899
  });
2864
- var quoteNodeSchema = z39.object({
2865
- nodeType: z39.literal(BLOCKS2.QUOTE),
2900
+ var quoteNodeSchema = z40.object({
2901
+ nodeType: z40.literal(BLOCKS2.QUOTE),
2866
2902
  data: emptyNodeDataSchema,
2867
- content: z39.array(paragraphNodeSchema)
2903
+ content: z40.array(paragraphNodeSchema)
2868
2904
  });
2869
- var tableHeaderCellNodeSchema = z39.object({
2870
- nodeType: z39.literal(BLOCKS2.TABLE_HEADER_CELL),
2905
+ var tableHeaderCellNodeSchema = z40.object({
2906
+ nodeType: z40.literal(BLOCKS2.TABLE_HEADER_CELL),
2871
2907
  data: emptyNodeDataSchema,
2872
- content: z39.array(paragraphNodeSchema)
2908
+ content: z40.array(paragraphNodeSchema)
2873
2909
  });
2874
- var tableCellNodeSchema = z39.object({
2875
- nodeType: z39.literal(BLOCKS2.TABLE_CELL),
2910
+ var tableCellNodeSchema = z40.object({
2911
+ nodeType: z40.literal(BLOCKS2.TABLE_CELL),
2876
2912
  data: emptyNodeDataSchema,
2877
- content: z39.array(paragraphNodeSchema)
2913
+ content: z40.array(paragraphNodeSchema)
2878
2914
  });
2879
- var tableRowNodeSchema = z39.object({
2880
- nodeType: z39.literal(BLOCKS2.TABLE_ROW),
2915
+ var tableRowNodeSchema = z40.object({
2916
+ nodeType: z40.literal(BLOCKS2.TABLE_ROW),
2881
2917
  data: emptyNodeDataSchema,
2882
- content: z39.array(z39.union([tableHeaderCellNodeSchema, tableCellNodeSchema]))
2918
+ content: z40.array(z40.union([tableHeaderCellNodeSchema, tableCellNodeSchema]))
2883
2919
  });
2884
- var tableNodeSchema = z39.object({
2885
- nodeType: z39.literal(BLOCKS2.TABLE),
2920
+ var tableNodeSchema = z40.object({
2921
+ nodeType: z40.literal(BLOCKS2.TABLE),
2886
2922
  data: emptyNodeDataSchema,
2887
- content: z39.array(tableRowNodeSchema)
2923
+ content: z40.array(tableRowNodeSchema)
2888
2924
  });
2889
- var orderedListNodeSchema = z39.lazy(
2890
- () => z39.object({
2891
- nodeType: z39.literal(BLOCKS2.OL_LIST),
2925
+ var orderedListNodeSchema = z40.lazy(
2926
+ () => z40.object({
2927
+ nodeType: z40.literal(BLOCKS2.OL_LIST),
2892
2928
  data: emptyNodeDataSchema,
2893
- content: z39.array(listItemNodeSchema)
2929
+ content: z40.array(listItemNodeSchema)
2894
2930
  })
2895
2931
  );
2896
- var unorderedListNodeSchema = z39.lazy(
2897
- () => z39.object({
2898
- nodeType: z39.literal(BLOCKS2.UL_LIST),
2932
+ var unorderedListNodeSchema = z40.lazy(
2933
+ () => z40.object({
2934
+ nodeType: z40.literal(BLOCKS2.UL_LIST),
2899
2935
  data: emptyNodeDataSchema,
2900
- content: z39.array(listItemNodeSchema)
2936
+ content: z40.array(listItemNodeSchema)
2901
2937
  })
2902
2938
  );
2903
- var listItemNodeSchema = z39.lazy(
2904
- () => z39.object({
2905
- nodeType: z39.literal(BLOCKS2.LIST_ITEM),
2939
+ var listItemNodeSchema = z40.lazy(
2940
+ () => z40.object({
2941
+ nodeType: z40.literal(BLOCKS2.LIST_ITEM),
2906
2942
  data: emptyNodeDataSchema,
2907
- content: z39.array(
2908
- z39.union([
2943
+ content: z40.array(
2944
+ z40.union([
2909
2945
  paragraphNodeSchema,
2910
2946
  orderedListNodeSchema,
2911
2947
  unorderedListNodeSchema
@@ -2913,8 +2949,8 @@ var listItemNodeSchema = z39.lazy(
2913
2949
  )
2914
2950
  })
2915
2951
  );
2916
- var topLevelBlockNodeSchema = z39.lazy(
2917
- () => z39.union([
2952
+ var topLevelBlockNodeSchema = z40.lazy(
2953
+ () => z40.union([
2918
2954
  paragraphNodeSchema,
2919
2955
  heading1NodeSchema,
2920
2956
  heading2NodeSchema,
@@ -2932,56 +2968,56 @@ var topLevelBlockNodeSchema = z39.lazy(
2932
2968
  tableNodeSchema
2933
2969
  ])
2934
2970
  );
2935
- var richTextDocumentSchema = z39.object({
2936
- nodeType: z39.literal(BLOCKS2.DOCUMENT),
2971
+ var richTextDocumentSchema = z40.object({
2972
+ nodeType: z40.literal(BLOCKS2.DOCUMENT),
2937
2973
  data: emptyNodeDataSchema,
2938
- content: z39.array(topLevelBlockNodeSchema)
2974
+ content: z40.array(topLevelBlockNodeSchema)
2939
2975
  }).describe("Contentful Rich Text document");
2940
2976
 
2941
2977
  // src/types/entryFieldSchema.ts
2942
- var linkSchema = z40.object({
2943
- sys: z40.object({
2944
- type: z40.literal("Link"),
2945
- linkType: z40.enum(["Entry", "Asset"]),
2946
- id: z40.string()
2978
+ var linkSchema = z41.object({
2979
+ sys: z41.object({
2980
+ type: z41.literal("Link"),
2981
+ linkType: z41.enum(["Entry", "Asset"]),
2982
+ id: z41.string()
2947
2983
  })
2948
2984
  });
2949
- var resourceLinkSchema = z40.object({
2950
- sys: z40.object({
2951
- type: z40.literal("ResourceLink"),
2952
- linkType: z40.string(),
2953
- urn: z40.string()
2985
+ var resourceLinkSchema = z41.object({
2986
+ sys: z41.object({
2987
+ type: z41.literal("ResourceLink"),
2988
+ linkType: z41.string(),
2989
+ urn: z41.string()
2954
2990
  })
2955
2991
  });
2956
- var locationSchema = z40.object({
2957
- lat: z40.number(),
2958
- lon: z40.number()
2992
+ var locationSchema = z41.object({
2993
+ lat: z41.number(),
2994
+ lon: z41.number()
2959
2995
  });
2960
- var jsonPrimitive = z40.union([z40.string(), z40.number(), z40.boolean(), z40.null()]);
2961
- var jsonValueSchema = z40.lazy(
2962
- () => z40.union([jsonPrimitive, z40.array(jsonValueSchema), z40.record(jsonValueSchema)]).describe("Freeform JSON value (not for Rich Text)")
2996
+ var jsonPrimitive = z41.union([z41.string(), z41.number(), z41.boolean(), z41.null()]);
2997
+ var jsonValueSchema = z41.lazy(
2998
+ () => z41.union([jsonPrimitive, z41.array(jsonValueSchema), z41.record(jsonValueSchema)]).describe("Freeform JSON value (not for Rich Text)")
2963
2999
  );
2964
- var fieldValueSchema = z40.union([
2965
- z40.string().describe("Symbol, Text, or Date field"),
2966
- z40.number().describe("Integer or Number field"),
2967
- z40.boolean().describe("Boolean field"),
3000
+ var fieldValueSchema = z41.union([
3001
+ z41.string().describe("Symbol, Text, or Date field"),
3002
+ z41.number().describe("Integer or Number field"),
3003
+ z41.boolean().describe("Boolean field"),
2968
3004
  richTextDocumentSchema,
2969
3005
  linkSchema.describe("Link field (Entry or Asset reference)"),
2970
3006
  resourceLinkSchema.describe("ResourceLink field"),
2971
3007
  locationSchema.describe("Location field"),
2972
- z40.array(z40.string()).describe("Array field of Symbols"),
2973
- z40.array(linkSchema).describe("Array field of Links"),
2974
- z40.array(resourceLinkSchema).describe("Array field of ResourceLinks"),
3008
+ z41.array(z41.string()).describe("Array field of Symbols"),
3009
+ z41.array(linkSchema).describe("Array field of Links"),
3010
+ z41.array(resourceLinkSchema).describe("Array field of ResourceLinks"),
2975
3011
  jsonValueSchema
2976
3012
  ]);
2977
- var localizedFieldSchema = z40.record(fieldValueSchema);
2978
- var entryFieldsSchema = z40.record(localizedFieldSchema).describe(
3013
+ var localizedFieldSchema = z41.record(fieldValueSchema);
3014
+ var entryFieldsSchema = z41.record(localizedFieldSchema).describe(
2979
3015
  "Field values to update. Keys are field IDs, values are locale-keyed objects. Will be merged with existing fields."
2980
3016
  );
2981
3017
 
2982
3018
  // src/tools/entries/createEntry.ts
2983
3019
  var CreateEntryToolParams = BaseToolSchema.extend({
2984
- contentTypeId: z41.string().describe("The ID of the content type to create an entry for"),
3020
+ contentTypeId: z42.string().describe("The ID of the content type to create an entry for"),
2985
3021
  fields: entryFieldsSchema.describe(
2986
3022
  "The field values for the new entry. Keys should be field IDs and values should be the field content."
2987
3023
  ),
@@ -3014,13 +3050,13 @@ function createEntryTool(config) {
3014
3050
  }
3015
3051
 
3016
3052
  // src/tools/entries/deleteEntry.ts
3017
- import { z as z42 } from "zod";
3053
+ import { z as z43 } from "zod";
3018
3054
  var DeleteEntryToolParams = BaseToolSchema.extend({
3019
- entryId: z42.string().describe("The ID of the entry to delete"),
3020
- confirm: z42.boolean().optional().describe(
3055
+ entryId: z43.string().describe("The ID of the entry to delete"),
3056
+ confirm: z43.boolean().optional().describe(
3021
3057
  "Set to true on the second call to actually perform the deletion. Required together with confirmToken."
3022
3058
  ),
3023
- confirmToken: z42.string().optional().describe(
3059
+ confirmToken: z43.string().optional().describe(
3024
3060
  "Token returned by the preview call; must be supplied with confirm: true."
3025
3061
  )
3026
3062
  });
@@ -3060,9 +3096,12 @@ function deleteEntryTool(config) {
3060
3096
  }
3061
3097
 
3062
3098
  // src/tools/entries/updateEntry.ts
3063
- import { z as z43 } from "zod";
3099
+ import { z as z44 } from "zod";
3064
3100
  var UpdateEntryToolParams = BaseToolSchema.extend({
3065
- entryId: z43.string().describe("The ID of the entry to update"),
3101
+ entryId: z44.string().describe("The ID of the entry to update"),
3102
+ version: z44.number().describe(
3103
+ "REQUIRED. The entry's sys.version as returned by get_entry. You must call get_entry first to read the current state and version. The update is rejected if this does not match the entry's current version, which means the entry changed since you read it."
3104
+ ),
3066
3105
  fields: entryFieldsSchema.describe(
3067
3106
  "The field values to update. Keys should be field IDs and values should be the field content. Will be merged with existing fields."
3068
3107
  ),
@@ -3081,6 +3120,11 @@ function updateEntryTool(config) {
3081
3120
  };
3082
3121
  const contentfulClient = createToolClient(config, args);
3083
3122
  const existingEntry = await contentfulClient.entry.get(params);
3123
+ if (args.version !== existingEntry.sys.version) {
3124
+ throw new Error(
3125
+ `Version conflict: the entry has changed since you read it (your version: ${args.version}, current version: ${existingEntry.sys.version}). Re-fetch the entry with get_entry and retry the update with the latest version.`
3126
+ );
3127
+ }
3084
3128
  const mergedFields = {
3085
3129
  ...existingEntry.fields,
3086
3130
  ...args.fields
@@ -3109,9 +3153,9 @@ function updateEntryTool(config) {
3109
3153
  }
3110
3154
 
3111
3155
  // src/tools/entries/getEntry.ts
3112
- import { z as z44 } from "zod";
3156
+ import { z as z45 } from "zod";
3113
3157
  var GetEntryToolParams = BaseToolSchema.extend({
3114
- entryId: z44.string().describe("The ID of the entry to retrieve")
3158
+ entryId: z45.string().describe("The ID of the entry to retrieve")
3115
3159
  });
3116
3160
  function getEntryTool(config) {
3117
3161
  async function tool2(args) {
@@ -3127,13 +3171,73 @@ function getEntryTool(config) {
3127
3171
  return withErrorHandling(tool2, "Error retrieving entry");
3128
3172
  }
3129
3173
 
3174
+ // src/tools/entries/resolveEntryReferences.ts
3175
+ import { z as z46 } from "zod";
3176
+ var ResolveEntryReferencesToolParams = BaseToolSchema.extend({
3177
+ entryId: z46.string().describe("The ID of the entry whose references should be resolved"),
3178
+ include: z46.number().int().min(1).max(10).optional().default(2).describe(
3179
+ "How many levels of linked entries to walk (1-10, default: 2). The CMA caps this at 10."
3180
+ )
3181
+ });
3182
+ function resolveEntryReferencesTool(config) {
3183
+ async function tool2(args) {
3184
+ const { include = 2 } = args;
3185
+ const params = {
3186
+ spaceId: args.spaceId,
3187
+ environmentId: args.environmentId,
3188
+ entryId: args.entryId,
3189
+ include
3190
+ };
3191
+ const contentfulClient = createToolClient(config, args);
3192
+ const references = await contentfulClient.entry.references(params);
3193
+ return createSuccessResponse("Entry references retrieved successfully", {
3194
+ references
3195
+ });
3196
+ }
3197
+ return withErrorHandling(tool2, "Error resolving entry references");
3198
+ }
3199
+
3200
+ // src/tools/entries/getEntrySnapshot.ts
3201
+ import { z as z47 } from "zod";
3202
+ var GetEntrySnapshotToolParams = BaseToolSchema.extend({
3203
+ entryId: z47.string().describe("The ID of the entry to retrieve snapshots for"),
3204
+ snapshotId: z47.string().optional().describe(
3205
+ "Optional snapshot ID. When provided, returns the full content of that single snapshot. When omitted, lists all available snapshots for the entry."
3206
+ )
3207
+ });
3208
+ function getEntrySnapshotTool(config) {
3209
+ async function tool2(args) {
3210
+ const contentfulClient = createToolClient(config, args);
3211
+ if (args.snapshotId) {
3212
+ const snapshot = await contentfulClient.snapshot.getForEntry({
3213
+ spaceId: args.spaceId,
3214
+ environmentId: args.environmentId,
3215
+ entryId: args.entryId,
3216
+ snapshotId: args.snapshotId
3217
+ });
3218
+ return createSuccessResponse("Entry snapshot retrieved successfully", {
3219
+ snapshot
3220
+ });
3221
+ }
3222
+ const snapshots = await contentfulClient.snapshot.getManyForEntry({
3223
+ spaceId: args.spaceId,
3224
+ environmentId: args.environmentId,
3225
+ entryId: args.entryId
3226
+ });
3227
+ return createSuccessResponse("Entry snapshots retrieved successfully", {
3228
+ snapshots
3229
+ });
3230
+ }
3231
+ return withErrorHandling(tool2, "Error retrieving entry snapshot");
3232
+ }
3233
+
3130
3234
  // src/tools/entries/publishEntry.ts
3131
- import { z as z45 } from "zod";
3235
+ import { z as z48 } from "zod";
3132
3236
  var PublishEntryToolParams = BaseToolSchema.extend({
3133
- entryId: z45.array(z45.string()).min(1).max(100).describe(
3237
+ entryId: z48.array(z48.string()).min(1).max(100).describe(
3134
3238
  "Array of entry IDs to publish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
3135
3239
  ),
3136
- dryRun: z45.boolean().optional().describe(
3240
+ dryRun: z48.boolean().optional().describe(
3137
3241
  "When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
3138
3242
  )
3139
3243
  });
@@ -3201,12 +3305,12 @@ function publishEntryTool(config) {
3201
3305
  }
3202
3306
 
3203
3307
  // src/tools/entries/unpublishEntry.ts
3204
- import { z as z46 } from "zod";
3308
+ import { z as z49 } from "zod";
3205
3309
  var UnpublishEntryToolParams = BaseToolSchema.extend({
3206
- entryId: z46.array(z46.string()).min(1).max(100).describe(
3310
+ entryId: z49.array(z49.string()).min(1).max(100).describe(
3207
3311
  "Array of entry IDs to unpublish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
3208
3312
  ),
3209
- dryRun: z46.boolean().optional().describe(
3313
+ dryRun: z49.boolean().optional().describe(
3210
3314
  "When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
3211
3315
  )
3212
3316
  });
@@ -3274,12 +3378,12 @@ function unpublishEntryTool(config) {
3274
3378
  }
3275
3379
 
3276
3380
  // src/tools/entries/archiveEntry.ts
3277
- import { z as z47 } from "zod";
3381
+ import { z as z50 } from "zod";
3278
3382
  var ArchiveEntryToolParams = BaseToolSchema.extend({
3279
- entryId: z47.array(z47.string()).min(1).max(100).describe(
3383
+ entryId: z50.array(z50.string()).min(1).max(100).describe(
3280
3384
  "Array of entry IDs to archive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
3281
3385
  ),
3282
- dryRun: z47.boolean().optional().describe(
3386
+ dryRun: z50.boolean().optional().describe(
3283
3387
  "When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
3284
3388
  )
3285
3389
  });
@@ -3340,12 +3444,12 @@ function archiveEntryTool(config) {
3340
3444
  }
3341
3445
 
3342
3446
  // src/tools/entries/unarchiveEntry.ts
3343
- import { z as z48 } from "zod";
3447
+ import { z as z51 } from "zod";
3344
3448
  var UnarchiveEntryToolParams = BaseToolSchema.extend({
3345
- entryId: z48.array(z48.string()).min(1).max(100).describe(
3449
+ entryId: z51.array(z51.string()).min(1).max(100).describe(
3346
3450
  "Array of entry IDs to unarchive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
3347
3451
  ),
3348
- dryRun: z48.boolean().optional().describe(
3452
+ dryRun: z51.boolean().optional().describe(
3349
3453
  "When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
3350
3454
  )
3351
3455
  });
@@ -3408,10 +3512,13 @@ function unarchiveEntryTool(config) {
3408
3512
  // src/tools/entries/register.ts
3409
3513
  function createEntryTools(config) {
3410
3514
  const searchEntries = searchEntriesTool(config);
3515
+ const semanticSearch = semanticSearchTool(config);
3411
3516
  const createEntry = createEntryTool(config);
3412
3517
  const deleteEntry = deleteEntryTool(config);
3413
3518
  const updateEntry = updateEntryTool(config);
3414
3519
  const getEntry = getEntryTool(config);
3520
+ const resolveEntryReferences = resolveEntryReferencesTool(config);
3521
+ const getEntrySnapshot = getEntrySnapshotTool(config);
3415
3522
  const publishEntry = publishEntryTool(config);
3416
3523
  const unpublishEntry = unpublishEntryTool(config);
3417
3524
  const archiveEntry = archiveEntryTool(config);
@@ -3427,6 +3534,16 @@ function createEntryTools(config) {
3427
3534
  },
3428
3535
  tool: searchEntries
3429
3536
  },
3537
+ semanticSearch: {
3538
+ title: "semantic_search",
3539
+ description: "Find entries by meaning using semantic (vector) search. Provide a descriptive natural-language query of what you're looking for \u2014 phrases resembling entry content work best (not questions or JSON). Optionally restrict to specific content types. Returns up to 10 matching entry references (unranked); use get_entry to fetch full content. Requires semantic search to be enabled for the environment.",
3540
+ inputParams: SemanticSearchToolParams.shape,
3541
+ annotations: {
3542
+ readOnlyHint: true,
3543
+ openWorldHint: false
3544
+ },
3545
+ tool: semanticSearch
3546
+ },
3430
3547
  createEntry: {
3431
3548
  title: "create_entry",
3432
3549
  description: "Create a new entry in Contentful. Before executing this function, you need to know the contentTypeId (not the content type NAME) and the fields of that contentType. You can get the fields definition by using the GET_CONTENT_TYPE tool. TAGS: To add tags to an entry, include a metadata object with a tags array. Each tag should be an object with sys.type='Link', sys.linkType='Tag', and sys.id='tagId'. Example: { metadata: { tags: [{ sys: { type: 'Link', linkType: 'Tag', id: 'myTagId' } }] } }.",
@@ -3449,9 +3566,29 @@ function createEntryTools(config) {
3449
3566
  },
3450
3567
  tool: getEntry
3451
3568
  },
3569
+ resolveEntryReferences: {
3570
+ title: "resolve_entry_references",
3571
+ description: "Recursively resolve an entry's references and return the entry plus its descendant entries and linked assets. Useful for verifying the structure of a page or any entry that links to other entries before or after edits, without issuing one fetch per descendant. Set `include` (1-10, default 2) to control how many levels deep to walk; the CMA caps this at 10.",
3572
+ inputParams: ResolveEntryReferencesToolParams.shape,
3573
+ annotations: {
3574
+ readOnlyHint: true,
3575
+ openWorldHint: false
3576
+ },
3577
+ tool: resolveEntryReferences
3578
+ },
3579
+ getEntrySnapshot: {
3580
+ title: "get_entry_snapshot",
3581
+ description: "Retrieve version history (snapshots) of an entry for safe rollback. Call with only an entryId to list all available snapshots (each has a snapshot ID and metadata). Call with both entryId and snapshotId to retrieve the full field content of that specific snapshot, which can then be used to restore a previous version.",
3582
+ inputParams: GetEntrySnapshotToolParams.shape,
3583
+ annotations: {
3584
+ readOnlyHint: true,
3585
+ openWorldHint: false
3586
+ },
3587
+ tool: getEntrySnapshot
3588
+ },
3452
3589
  updateEntry: {
3453
3590
  title: "update_entry",
3454
- description: "Update an existing entry. The handler will merge your field updates with the existing entry fields, so you only need to provide the fields you want to change. However, for multiple-locale fields, all existing locales must be included in the update.",
3591
+ description: "Update an existing entry. You MUST call get_entry first to read the current state, then pass the sys.version you received as the version parameter. The handler merges your field updates with the existing entry fields, so you only need to provide the fields you want to change. However, for multiple-locale fields, all existing locales must be included in the update. If the version is stale (the entry changed since you read it), the update is rejected and you must re-fetch with get_entry.",
3455
3592
  inputParams: UpdateEntryToolParams.shape,
3456
3593
  annotations: {
3457
3594
  readOnlyHint: false,
@@ -3525,11 +3662,11 @@ function createEntryTools(config) {
3525
3662
  }
3526
3663
 
3527
3664
  // src/tools/environments/createEnvironment.ts
3528
- import { z as z49 } from "zod";
3665
+ import { z as z52 } from "zod";
3529
3666
  var CreateEnvironmentToolParams = BaseToolSchema.extend({
3530
- environmentId: z49.string().describe("The ID of the environment to create"),
3531
- name: z49.string().describe("The name of the environment to create"),
3532
- sourceEnvironmentId: z49.string().describe(
3667
+ environmentId: z52.string().describe("The ID of the environment to create"),
3668
+ name: z52.string().describe("The name of the environment to create"),
3669
+ sourceEnvironmentId: z52.string().describe(
3533
3670
  "The ID of the source environment to clone from (defaults to master)"
3534
3671
  ).optional()
3535
3672
  });
@@ -3560,15 +3697,15 @@ function createEnvironmentTool(config) {
3560
3697
  }
3561
3698
 
3562
3699
  // src/tools/environments/listEnvironments.ts
3563
- import { z as z50 } from "zod";
3700
+ import { z as z53 } from "zod";
3564
3701
  var ListEnvironmentsToolParams = BaseToolSchema.extend({
3565
- environmentId: z50.string().optional().describe(
3702
+ environmentId: z53.string().optional().describe(
3566
3703
  "The ID of the Contentful environment (not required for listing)"
3567
3704
  ),
3568
- limit: z50.number().optional().describe("Maximum number of environments to return (max 10)"),
3569
- skip: z50.number().optional().describe("Skip this many environments for pagination"),
3570
- select: z50.string().optional().describe("Comma-separated list of fields to return"),
3571
- order: z50.string().optional().describe("Order environments by this field")
3705
+ limit: z53.number().optional().describe("Maximum number of environments to return (max 10)"),
3706
+ skip: z53.number().optional().describe("Skip this many environments for pagination"),
3707
+ select: z53.string().optional().describe("Comma-separated list of fields to return"),
3708
+ order: z53.string().optional().describe("Order environments by this field")
3572
3709
  });
3573
3710
  function listEnvironmentsTool(config) {
3574
3711
  async function tool2(args) {
@@ -3614,13 +3751,13 @@ function listEnvironmentsTool(config) {
3614
3751
  }
3615
3752
 
3616
3753
  // src/tools/environments/deleteEnvironment.ts
3617
- import { z as z51 } from "zod";
3754
+ import { z as z54 } from "zod";
3618
3755
  var DeleteEnvironmentToolParams = BaseToolSchema.extend({
3619
- environmentId: z51.string().describe("The ID of the environment to delete"),
3620
- confirm: z51.boolean().optional().describe(
3756
+ environmentId: z54.string().describe("The ID of the environment to delete"),
3757
+ confirm: z54.boolean().optional().describe(
3621
3758
  "Set to true on the second call to actually perform the deletion. Required together with confirmToken."
3622
3759
  ),
3623
- confirmToken: z51.string().optional().describe(
3760
+ confirmToken: z54.string().optional().describe(
3624
3761
  "Token returned by the preview call; must be supplied with confirm: true."
3625
3762
  )
3626
3763
  });
@@ -3704,9 +3841,9 @@ function createEnvironmentTools(config) {
3704
3841
  }
3705
3842
 
3706
3843
  // src/tools/locales/getLocale.ts
3707
- import { z as z52 } from "zod";
3844
+ import { z as z55 } from "zod";
3708
3845
  var GetLocaleToolParams = BaseToolSchema.extend({
3709
- localeId: z52.string().describe("The ID of the locale to retrieve")
3846
+ localeId: z55.string().describe("The ID of the locale to retrieve")
3710
3847
  });
3711
3848
  function getLocaleTool(config) {
3712
3849
  async function tool2(args) {
@@ -3723,21 +3860,21 @@ function getLocaleTool(config) {
3723
3860
  }
3724
3861
 
3725
3862
  // src/tools/locales/createLocale.ts
3726
- import { z as z53 } from "zod";
3863
+ import { z as z56 } from "zod";
3727
3864
  var CreateLocaleToolParams = BaseToolSchema.extend({
3728
- name: z53.string().describe("The name of the locale"),
3729
- code: z53.string().describe('The locale code (e.g., "en-US")'),
3730
- fallbackCode: z53.string().nullable().describe(
3865
+ name: z56.string().describe("The name of the locale"),
3866
+ code: z56.string().describe('The locale code (e.g., "en-US")'),
3867
+ fallbackCode: z56.string().nullable().describe(
3731
3868
  "The locale code to fallback to when there is no content for the current locale"
3732
3869
  ),
3733
- contentDeliveryApi: z53.boolean().optional().default(true).describe(
3870
+ contentDeliveryApi: z56.boolean().optional().default(true).describe(
3734
3871
  "If the content under this locale should be available on the CDA (for public reading)"
3735
3872
  ),
3736
- contentManagementApi: z53.boolean().optional().default(true).describe(
3873
+ contentManagementApi: z56.boolean().optional().default(true).describe(
3737
3874
  "If the content under this locale should be available on the CMA (for editing)"
3738
3875
  ),
3739
- default: z53.boolean().optional().default(false).describe("If this is the default locale"),
3740
- optional: z53.boolean().optional().default(false).describe("If the locale needs to be filled in on entries or not")
3876
+ default: z56.boolean().optional().default(false).describe("If this is the default locale"),
3877
+ optional: z56.boolean().optional().default(false).describe("If the locale needs to be filled in on entries or not")
3741
3878
  });
3742
3879
  function createLocaleTool(config) {
3743
3880
  async function tool2(args) {
@@ -3764,13 +3901,13 @@ function createLocaleTool(config) {
3764
3901
  }
3765
3902
 
3766
3903
  // src/tools/locales/listLocales.ts
3767
- import { z as z54 } from "zod";
3904
+ import { z as z57 } from "zod";
3768
3905
  var ListLocaleToolParams = BaseToolSchema.extend({
3769
- limit: z54.number().optional().describe("Maximum number of locales to return"),
3770
- skip: z54.number().optional().describe("Skip this many locales for pagination"),
3771
- select: z54.string().optional().describe("Comma-separated list of fields to return"),
3772
- include: z54.number().optional().describe("Include this many levels of linked entries"),
3773
- order: z54.string().optional().describe("Order locales by this field")
3906
+ limit: z57.number().optional().describe("Maximum number of locales to return"),
3907
+ skip: z57.number().optional().describe("Skip this many locales for pagination"),
3908
+ select: z57.string().optional().describe("Comma-separated list of fields to return"),
3909
+ include: z57.number().optional().describe("Include this many levels of linked entries"),
3910
+ order: z57.string().optional().describe("Order locales by this field")
3774
3911
  });
3775
3912
  function listLocaleTool(config) {
3776
3913
  async function tool2(args) {
@@ -3823,23 +3960,23 @@ function listLocaleTool(config) {
3823
3960
  }
3824
3961
 
3825
3962
  // src/tools/locales/updateLocale.ts
3826
- import { z as z55 } from "zod";
3963
+ import { z as z58 } from "zod";
3827
3964
  var UpdateLocaleToolParams = BaseToolSchema.extend({
3828
- localeId: z55.string().describe("The ID of the locale to update"),
3829
- fields: z55.object({
3830
- name: z55.string().optional().describe("The name of the locale"),
3965
+ localeId: z58.string().describe("The ID of the locale to update"),
3966
+ fields: z58.object({
3967
+ name: z58.string().optional().describe("The name of the locale"),
3831
3968
  // NOTE: internal_code changes are not allowed
3832
- code: z55.string().optional().describe("The code of the locale"),
3833
- fallbackCode: z55.string().optional().describe(
3969
+ code: z58.string().optional().describe("The code of the locale"),
3970
+ fallbackCode: z58.string().optional().describe(
3834
3971
  "The locale code to fallback to when there is no content for the current locale"
3835
3972
  ),
3836
- contentDeliveryApi: z55.boolean().optional().describe(
3973
+ contentDeliveryApi: z58.boolean().optional().describe(
3837
3974
  "If the content under this locale should be available on the CDA (for public reading)"
3838
3975
  ),
3839
- contentManagementApi: z55.boolean().optional().describe(
3976
+ contentManagementApi: z58.boolean().optional().describe(
3840
3977
  "If the content under this locale should be available on the CMA (for editing)"
3841
3978
  ),
3842
- optional: z55.boolean().optional().describe("If the locale needs to be filled in on entries or not")
3979
+ optional: z58.boolean().optional().describe("If the locale needs to be filled in on entries or not")
3843
3980
  })
3844
3981
  });
3845
3982
  function updateLocaleTool(config) {
@@ -3869,13 +4006,13 @@ function updateLocaleTool(config) {
3869
4006
  }
3870
4007
 
3871
4008
  // src/tools/locales/deleteLocale.ts
3872
- import { z as z56 } from "zod";
4009
+ import { z as z59 } from "zod";
3873
4010
  var DeleteLocaleToolParams = BaseToolSchema.extend({
3874
- localeId: z56.string().describe("The ID of the locale to delete"),
3875
- confirm: z56.boolean().optional().describe(
4011
+ localeId: z59.string().describe("The ID of the locale to delete"),
4012
+ confirm: z59.boolean().optional().describe(
3876
4013
  "Set to true on the second call to actually perform the deletion. Required together with confirmToken."
3877
4014
  ),
3878
- confirmToken: z56.string().optional().describe(
4015
+ confirmToken: z59.string().optional().describe(
3879
4016
  "Token returned by the preview call; must be supplied with confirm: true."
3880
4017
  )
3881
4018
  });
@@ -3982,13 +4119,13 @@ function createLocaleTools(config) {
3982
4119
  }
3983
4120
 
3984
4121
  // src/tools/orgs/listOrgs.ts
3985
- import { z as z57 } from "zod";
4122
+ import { z as z60 } from "zod";
3986
4123
  import { createClient as createClient2 } from "contentful-management";
3987
- var ListOrgsToolParams = z57.object({
3988
- limit: z57.number().optional().describe("Maximum number of organizations to return (max 10)"),
3989
- skip: z57.number().optional().describe("Skip this many organizations for pagination"),
3990
- select: z57.string().optional().describe("Comma-separated list of fields to return"),
3991
- order: z57.string().optional().describe("Order organizations by this field")
4124
+ var ListOrgsToolParams = z60.object({
4125
+ limit: z60.number().optional().describe("Maximum number of organizations to return (max 10)"),
4126
+ skip: z60.number().optional().describe("Skip this many organizations for pagination"),
4127
+ select: z60.string().optional().describe("Comma-separated list of fields to return"),
4128
+ order: z60.string().optional().describe("Order organizations by this field")
3992
4129
  });
3993
4130
  function listOrgsTool(config) {
3994
4131
  async function tool2(args) {
@@ -4030,10 +4167,10 @@ function listOrgsTool(config) {
4030
4167
  }
4031
4168
 
4032
4169
  // src/tools/orgs/getOrg.ts
4033
- import { z as z58 } from "zod";
4170
+ import { z as z61 } from "zod";
4034
4171
  import { createClient as createClient3 } from "contentful-management";
4035
- var GetOrgToolParams = z58.object({
4036
- organizationId: z58.string().describe("The ID of the organization to retrieve")
4172
+ var GetOrgToolParams = z61.object({
4173
+ organizationId: z61.string().describe("The ID of the organization to retrieve")
4037
4174
  });
4038
4175
  function getOrgTool(config) {
4039
4176
  async function tool2(args) {
@@ -4079,13 +4216,13 @@ function createOrgTools(config) {
4079
4216
  }
4080
4217
 
4081
4218
  // src/tools/spaces/listSpaces.ts
4082
- import { z as z59 } from "zod";
4219
+ import { z as z62 } from "zod";
4083
4220
  import { createClient as createClient4 } from "contentful-management";
4084
- var ListSpacesToolParams = z59.object({
4085
- limit: z59.number().optional().describe("Maximum number of spaces to return (max 10)"),
4086
- skip: z59.number().optional().describe("Skip this many spaces for pagination"),
4087
- select: z59.string().optional().describe("Comma-separated list of fields to return"),
4088
- order: z59.string().optional().describe("Order spaces by this field")
4221
+ var ListSpacesToolParams = z62.object({
4222
+ limit: z62.number().optional().describe("Maximum number of spaces to return (max 10)"),
4223
+ skip: z62.number().optional().describe("Skip this many spaces for pagination"),
4224
+ select: z62.string().optional().describe("Comma-separated list of fields to return"),
4225
+ order: z62.string().optional().describe("Order spaces by this field")
4089
4226
  });
4090
4227
  function listSpacesTool(config) {
4091
4228
  async function tool2(args) {
@@ -4127,10 +4264,10 @@ function listSpacesTool(config) {
4127
4264
  }
4128
4265
 
4129
4266
  // src/tools/spaces/getSpace.ts
4130
- import { z as z60 } from "zod";
4267
+ import { z as z63 } from "zod";
4131
4268
  import { createClient as createClient5 } from "contentful-management";
4132
- var GetSpaceToolParams = z60.object({
4133
- spaceId: z60.string().describe("The ID of the space to retrieve")
4269
+ var GetSpaceToolParams = z63.object({
4270
+ spaceId: z63.string().describe("The ID of the space to retrieve")
4134
4271
  });
4135
4272
  function getSpaceTool(config) {
4136
4273
  async function tool2(args) {
@@ -4174,12 +4311,12 @@ function createSpaceTools(config) {
4174
4311
  }
4175
4312
 
4176
4313
  // src/tools/tags/listTags.ts
4177
- import { z as z61 } from "zod";
4314
+ import { z as z64 } from "zod";
4178
4315
  var ListTagsToolParams = BaseToolSchema.extend({
4179
- limit: z61.number().optional().describe("Maximum number of tags to return"),
4180
- skip: z61.number().optional().describe("Skip this many tags for pagination"),
4181
- select: z61.string().optional().describe("Comma-separated list of fields to return"),
4182
- order: z61.string().optional().describe("Order tags by this field")
4316
+ limit: z64.number().optional().describe("Maximum number of tags to return"),
4317
+ skip: z64.number().optional().describe("Skip this many tags for pagination"),
4318
+ select: z64.string().optional().describe("Comma-separated list of fields to return"),
4319
+ order: z64.string().optional().describe("Order tags by this field")
4183
4320
  });
4184
4321
  function listTagsTool(config) {
4185
4322
  async function tool2(args) {
@@ -4225,11 +4362,11 @@ function listTagsTool(config) {
4225
4362
  }
4226
4363
 
4227
4364
  // src/tools/tags/createTag.ts
4228
- import { z as z62 } from "zod";
4365
+ import { z as z65 } from "zod";
4229
4366
  var CreateTagToolParams = BaseToolSchema.extend({
4230
- name: z62.string().describe("The name of the tag"),
4231
- id: z62.string().describe("The ID of the tag"),
4232
- visibility: z62.enum(["public", "private"]).describe("The visibility of the tag. Default to private if not specified")
4367
+ name: z65.string().describe("The name of the tag"),
4368
+ id: z65.string().describe("The ID of the tag"),
4369
+ visibility: z65.enum(["public", "private"]).describe("The visibility of the tag. Default to private if not specified")
4233
4370
  });
4234
4371
  function createTagTool(config) {
4235
4372
  async function tool2(args) {
@@ -4283,34 +4420,34 @@ function createTagTools(config) {
4283
4420
  }
4284
4421
 
4285
4422
  // src/tools/taxonomies/concept-schemes/createConceptScheme.ts
4286
- import { z as z64 } from "zod";
4423
+ import { z as z67 } from "zod";
4287
4424
  import { createClient as createClient6 } from "contentful-management";
4288
4425
 
4289
4426
  // src/types/conceptPayloadTypes.ts
4290
- import { z as z63 } from "zod";
4291
- var TaxonomyConceptLinkSchema = z63.object({
4292
- sys: z63.object({
4293
- type: z63.literal("Link"),
4294
- linkType: z63.literal("TaxonomyConcept"),
4295
- id: z63.string()
4427
+ import { z as z66 } from "zod";
4428
+ var TaxonomyConceptLinkSchema = z66.object({
4429
+ sys: z66.object({
4430
+ type: z66.literal("Link"),
4431
+ linkType: z66.literal("TaxonomyConcept"),
4432
+ id: z66.string()
4296
4433
  })
4297
4434
  });
4298
4435
 
4299
4436
  // src/tools/taxonomies/concept-schemes/createConceptScheme.ts
4300
- var CreateConceptSchemeToolParams = z64.object({
4301
- organizationId: z64.string().describe("The ID of the Contentful organization"),
4302
- conceptSchemeId: z64.string().optional().describe(
4437
+ var CreateConceptSchemeToolParams = z67.object({
4438
+ organizationId: z67.string().describe("The ID of the Contentful organization"),
4439
+ conceptSchemeId: z67.string().optional().describe(
4303
4440
  "Optional user-defined ID for the concept scheme. If not provided, Contentful will generate one automatically."
4304
4441
  ),
4305
- prefLabel: z64.record(z64.string()).describe("The preferred label for the concept scheme (localized)"),
4306
- uri: z64.string().nullable().optional().describe("The URI for the concept scheme"),
4307
- definition: z64.record(z64.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
4308
- editorialNote: z64.record(z64.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
4309
- historyNote: z64.record(z64.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
4310
- example: z64.record(z64.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
4311
- note: z64.record(z64.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
4312
- scopeNote: z64.record(z64.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
4313
- topConcepts: z64.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme")
4442
+ prefLabel: z67.record(z67.string()).describe("The preferred label for the concept scheme (localized)"),
4443
+ uri: z67.string().nullable().optional().describe("The URI for the concept scheme"),
4444
+ definition: z67.record(z67.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
4445
+ editorialNote: z67.record(z67.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
4446
+ historyNote: z67.record(z67.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
4447
+ example: z67.record(z67.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
4448
+ note: z67.record(z67.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
4449
+ scopeNote: z67.record(z67.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
4450
+ topConcepts: z67.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme")
4314
4451
  });
4315
4452
  function createConceptSchemeTool(config) {
4316
4453
  async function tool2(args) {
@@ -4350,11 +4487,11 @@ function createConceptSchemeTool(config) {
4350
4487
  }
4351
4488
 
4352
4489
  // src/tools/taxonomies/concept-schemes/getConceptScheme.ts
4353
- import { z as z65 } from "zod";
4490
+ import { z as z68 } from "zod";
4354
4491
  import { createClient as createClient7 } from "contentful-management";
4355
- var GetConceptSchemeToolParams = z65.object({
4356
- organizationId: z65.string().describe("The ID of the Contentful organization"),
4357
- conceptSchemeId: z65.string().describe("The ID of the concept scheme to retrieve")
4492
+ var GetConceptSchemeToolParams = z68.object({
4493
+ organizationId: z68.string().describe("The ID of the Contentful organization"),
4494
+ conceptSchemeId: z68.string().describe("The ID of the concept scheme to retrieve")
4358
4495
  });
4359
4496
  function getConceptSchemeTool(config) {
4360
4497
  async function tool2(args) {
@@ -4374,25 +4511,25 @@ function getConceptSchemeTool(config) {
4374
4511
  }
4375
4512
 
4376
4513
  // src/tools/taxonomies/concept-schemes/listConceptSchemes.ts
4377
- import { z as z66 } from "zod";
4514
+ import { z as z69 } from "zod";
4378
4515
  import { createClient as createClient8 } from "contentful-management";
4379
4516
  import { cloneDeep } from "lodash-es";
4380
- var ListConceptSchemesToolParams = z66.object({
4381
- organizationId: z66.string(),
4382
- query: z66.union([
4383
- z66.object({
4384
- query: z66.string().optional(),
4385
- pageNext: z66.string().optional().describe("Cursor token for the next page of concept schemes"),
4386
- pagePrev: z66.string().optional().describe(
4517
+ var ListConceptSchemesToolParams = z69.object({
4518
+ organizationId: z69.string(),
4519
+ query: z69.union([
4520
+ z69.object({
4521
+ query: z69.string().optional(),
4522
+ pageNext: z69.string().optional().describe("Cursor token for the next page of concept schemes"),
4523
+ pagePrev: z69.string().optional().describe(
4387
4524
  "Cursor token for the previous page of concept schemes"
4388
4525
  ),
4389
- limit: z66.number().optional().describe("Maximum number of concept schemes to return"),
4390
- order: z66.string().optional().describe("Order concept schemes by this field"),
4391
- skip: z66.never().optional()
4526
+ limit: z69.number().optional().describe("Maximum number of concept schemes to return"),
4527
+ order: z69.string().optional().describe("Order concept schemes by this field"),
4528
+ skip: z69.never().optional()
4392
4529
  }).passthrough(),
4393
4530
  // handles [key: string]: any from BasicQueryOptions
4394
- z66.object({
4395
- pageUrl: z66.string().optional()
4531
+ z69.object({
4532
+ pageUrl: z69.string().optional()
4396
4533
  })
4397
4534
  ]).optional().describe(
4398
4535
  'Query parameters for listing concept schemes, supports either pageUrl for cursor-based pagination. Offset "skip" pagination is not supported.'
@@ -4462,22 +4599,22 @@ function listConceptSchemesTool(config) {
4462
4599
  }
4463
4600
 
4464
4601
  // src/tools/taxonomies/concept-schemes/updateConceptScheme.ts
4465
- import { z as z67 } from "zod";
4602
+ import { z as z70 } from "zod";
4466
4603
  import { createClient as createClient9 } from "contentful-management";
4467
- var UpdateConceptSchemeToolParams = z67.object({
4468
- organizationId: z67.string().describe("The ID of the Contentful organization"),
4469
- conceptSchemeId: z67.string().describe("The ID of the concept scheme to update"),
4470
- version: z67.number().describe("The current version of the concept scheme"),
4471
- prefLabel: z67.record(z67.string()).optional().describe("The preferred label for the concept scheme (localized)"),
4472
- uri: z67.string().nullable().optional().describe("The URI for the concept scheme"),
4473
- definition: z67.record(z67.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
4474
- editorialNote: z67.record(z67.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
4475
- historyNote: z67.record(z67.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
4476
- example: z67.record(z67.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
4477
- note: z67.record(z67.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
4478
- scopeNote: z67.record(z67.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
4479
- topConcepts: z67.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme"),
4480
- addConcept: z67.string().optional().describe(
4604
+ var UpdateConceptSchemeToolParams = z70.object({
4605
+ organizationId: z70.string().describe("The ID of the Contentful organization"),
4606
+ conceptSchemeId: z70.string().describe("The ID of the concept scheme to update"),
4607
+ version: z70.number().describe("The current version of the concept scheme"),
4608
+ prefLabel: z70.record(z70.string()).optional().describe("The preferred label for the concept scheme (localized)"),
4609
+ uri: z70.string().nullable().optional().describe("The URI for the concept scheme"),
4610
+ definition: z70.record(z70.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
4611
+ editorialNote: z70.record(z70.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
4612
+ historyNote: z70.record(z70.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
4613
+ example: z70.record(z70.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
4614
+ note: z70.record(z70.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
4615
+ scopeNote: z70.record(z70.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
4616
+ topConcepts: z70.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme"),
4617
+ addConcept: z70.string().optional().describe(
4481
4618
  "ID of a concept to add to this scheme (adds to both concepts and topConcepts)"
4482
4619
  )
4483
4620
  });
@@ -4552,15 +4689,15 @@ function updateConceptSchemeTool(config) {
4552
4689
  }
4553
4690
 
4554
4691
  // src/tools/taxonomies/concept-schemes/deleteConceptScheme.ts
4555
- import { z as z68 } from "zod";
4692
+ import { z as z71 } from "zod";
4556
4693
  import { createClient as createClient10 } from "contentful-management";
4557
- var DeleteConceptSchemeToolParams = z68.object({
4558
- organizationId: z68.string().describe("The ID of the Contentful organization"),
4559
- conceptSchemeId: z68.string().describe("The ID of the concept scheme to delete"),
4560
- confirm: z68.boolean().optional().describe(
4694
+ var DeleteConceptSchemeToolParams = z71.object({
4695
+ organizationId: z71.string().describe("The ID of the Contentful organization"),
4696
+ conceptSchemeId: z71.string().describe("The ID of the concept scheme to delete"),
4697
+ confirm: z71.boolean().optional().describe(
4561
4698
  "Set to true on the second call to actually perform the deletion. Required together with confirmToken."
4562
4699
  ),
4563
- confirmToken: z68.string().optional().describe(
4700
+ confirmToken: z71.string().optional().describe(
4564
4701
  "Token returned by the preview call; must be supplied with confirm: true."
4565
4702
  )
4566
4703
  });
@@ -4669,26 +4806,26 @@ function createConceptSchemeTools(config) {
4669
4806
  }
4670
4807
 
4671
4808
  // src/tools/taxonomies/concepts/createConcept.ts
4672
- import { z as z69 } from "zod";
4809
+ import { z as z72 } from "zod";
4673
4810
  import { createClient as createClient11 } from "contentful-management";
4674
- var CreateConceptToolParams = z69.object({
4675
- organizationId: z69.string().describe("The ID of the Contentful organization"),
4676
- conceptId: z69.string().optional().describe(
4811
+ var CreateConceptToolParams = z72.object({
4812
+ organizationId: z72.string().describe("The ID of the Contentful organization"),
4813
+ conceptId: z72.string().optional().describe(
4677
4814
  "Optional user-defined ID for the concept. If not provided, Contentful will generate one automatically."
4678
4815
  ),
4679
- prefLabel: z69.record(z69.string()).describe("The preferred label for the concept (localized)"),
4680
- uri: z69.string().nullable().optional().describe("The URI for the concept"),
4681
- altLabels: z69.record(z69.array(z69.string())).optional().describe("Alternative labels for the concept (localized)"),
4682
- hiddenLabels: z69.record(z69.array(z69.string())).optional().describe("Hidden labels for the concept (localized)"),
4683
- definition: z69.record(z69.string().nullable()).optional().describe("Definition of the concept (localized)"),
4684
- editorialNote: z69.record(z69.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
4685
- historyNote: z69.record(z69.string().nullable()).optional().describe("History note for the concept (localized)"),
4686
- example: z69.record(z69.string().nullable()).optional().describe("Example for the concept (localized)"),
4687
- note: z69.record(z69.string().nullable()).optional().describe("General note for the concept (localized)"),
4688
- scopeNote: z69.record(z69.string().nullable()).optional().describe("Scope note for the concept (localized)"),
4689
- notations: z69.array(z69.string()).optional().describe("Notations for the concept"),
4690
- broader: z69.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
4691
- related: z69.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
4816
+ prefLabel: z72.record(z72.string()).describe("The preferred label for the concept (localized)"),
4817
+ uri: z72.string().nullable().optional().describe("The URI for the concept"),
4818
+ altLabels: z72.record(z72.array(z72.string())).optional().describe("Alternative labels for the concept (localized)"),
4819
+ hiddenLabels: z72.record(z72.array(z72.string())).optional().describe("Hidden labels for the concept (localized)"),
4820
+ definition: z72.record(z72.string().nullable()).optional().describe("Definition of the concept (localized)"),
4821
+ editorialNote: z72.record(z72.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
4822
+ historyNote: z72.record(z72.string().nullable()).optional().describe("History note for the concept (localized)"),
4823
+ example: z72.record(z72.string().nullable()).optional().describe("Example for the concept (localized)"),
4824
+ note: z72.record(z72.string().nullable()).optional().describe("General note for the concept (localized)"),
4825
+ scopeNote: z72.record(z72.string().nullable()).optional().describe("Scope note for the concept (localized)"),
4826
+ notations: z72.array(z72.string()).optional().describe("Notations for the concept"),
4827
+ broader: z72.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
4828
+ related: z72.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
4692
4829
  });
4693
4830
  function createConceptTool(config) {
4694
4831
  async function tool2(args) {
@@ -4723,15 +4860,15 @@ function createConceptTool(config) {
4723
4860
  }
4724
4861
 
4725
4862
  // src/tools/taxonomies/concepts/deleteConcept.ts
4726
- import { z as z70 } from "zod";
4863
+ import { z as z73 } from "zod";
4727
4864
  import { createClient as createClient12 } from "contentful-management";
4728
- var DeleteConceptToolParams = z70.object({
4729
- organizationId: z70.string().describe("The ID of the Contentful organization"),
4730
- conceptId: z70.string().describe("The ID of the concept to delete"),
4731
- confirm: z70.boolean().optional().describe(
4865
+ var DeleteConceptToolParams = z73.object({
4866
+ organizationId: z73.string().describe("The ID of the Contentful organization"),
4867
+ conceptId: z73.string().describe("The ID of the concept to delete"),
4868
+ confirm: z73.boolean().optional().describe(
4732
4869
  "Set to true on the second call to actually perform the deletion. Required together with confirmToken."
4733
4870
  ),
4734
- confirmToken: z70.string().optional().describe(
4871
+ confirmToken: z73.string().optional().describe(
4735
4872
  "Token returned by the preview call; must be supplied with confirm: true."
4736
4873
  )
4737
4874
  });
@@ -4768,25 +4905,25 @@ function deleteConceptTool(config) {
4768
4905
  }
4769
4906
 
4770
4907
  // src/tools/taxonomies/concepts/updateConcept.ts
4771
- import { z as z71 } from "zod";
4908
+ import { z as z74 } from "zod";
4772
4909
  import { createClient as createClient13 } from "contentful-management";
4773
- var UpdateConceptToolParams = z71.object({
4774
- organizationId: z71.string().describe("The ID of the Contentful organization"),
4775
- conceptId: z71.string().describe("The ID of the concept to update"),
4776
- version: z71.number().describe("The current version of the concept"),
4777
- prefLabel: z71.record(z71.string()).optional().describe("The preferred label for the concept (localized)"),
4778
- uri: z71.string().nullable().optional().describe("The URI for the concept"),
4779
- altLabels: z71.record(z71.array(z71.string())).optional().describe("Alternative labels for the concept (localized)"),
4780
- hiddenLabels: z71.record(z71.array(z71.string())).optional().describe("Hidden labels for the concept (localized)"),
4781
- definition: z71.record(z71.string().nullable()).optional().describe("Definition of the concept (localized)"),
4782
- editorialNote: z71.record(z71.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
4783
- historyNote: z71.record(z71.string().nullable()).optional().describe("History note for the concept (localized)"),
4784
- example: z71.record(z71.string().nullable()).optional().describe("Example for the concept (localized)"),
4785
- note: z71.record(z71.string().nullable()).optional().describe("General note for the concept (localized)"),
4786
- scopeNote: z71.record(z71.string().nullable()).optional().describe("Scope note for the concept (localized)"),
4787
- notations: z71.array(z71.string()).optional().describe("Notations for the concept"),
4788
- broader: z71.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
4789
- related: z71.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
4910
+ var UpdateConceptToolParams = z74.object({
4911
+ organizationId: z74.string().describe("The ID of the Contentful organization"),
4912
+ conceptId: z74.string().describe("The ID of the concept to update"),
4913
+ version: z74.number().describe("The current version of the concept"),
4914
+ prefLabel: z74.record(z74.string()).optional().describe("The preferred label for the concept (localized)"),
4915
+ uri: z74.string().nullable().optional().describe("The URI for the concept"),
4916
+ altLabels: z74.record(z74.array(z74.string())).optional().describe("Alternative labels for the concept (localized)"),
4917
+ hiddenLabels: z74.record(z74.array(z74.string())).optional().describe("Hidden labels for the concept (localized)"),
4918
+ definition: z74.record(z74.string().nullable()).optional().describe("Definition of the concept (localized)"),
4919
+ editorialNote: z74.record(z74.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
4920
+ historyNote: z74.record(z74.string().nullable()).optional().describe("History note for the concept (localized)"),
4921
+ example: z74.record(z74.string().nullable()).optional().describe("Example for the concept (localized)"),
4922
+ note: z74.record(z74.string().nullable()).optional().describe("General note for the concept (localized)"),
4923
+ scopeNote: z74.record(z74.string().nullable()).optional().describe("Scope note for the concept (localized)"),
4924
+ notations: z74.array(z74.string()).optional().describe("Notations for the concept"),
4925
+ broader: z74.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
4926
+ related: z74.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
4790
4927
  });
4791
4928
  function updateConceptTool(config) {
4792
4929
  async function tool2(args) {
@@ -4828,11 +4965,11 @@ function updateConceptTool(config) {
4828
4965
  }
4829
4966
 
4830
4967
  // src/tools/taxonomies/concepts/getConcept.ts
4831
- import { z as z72 } from "zod";
4968
+ import { z as z75 } from "zod";
4832
4969
  import { createClient as createClient14 } from "contentful-management";
4833
- var GetConceptToolParams = z72.object({
4834
- organizationId: z72.string().describe("The ID of the Contentful organization"),
4835
- conceptId: z72.string().describe("The ID of the concept to retrieve")
4970
+ var GetConceptToolParams = z75.object({
4971
+ organizationId: z75.string().describe("The ID of the Contentful organization"),
4972
+ conceptId: z75.string().describe("The ID of the concept to retrieve")
4836
4973
  });
4837
4974
  function getConceptTool(config) {
4838
4975
  async function tool2(args) {
@@ -4849,18 +4986,18 @@ function getConceptTool(config) {
4849
4986
  }
4850
4987
 
4851
4988
  // src/tools/taxonomies/concepts/listConcepts.ts
4852
- import { z as z73 } from "zod";
4989
+ import { z as z76 } from "zod";
4853
4990
  import { createClient as createClient15 } from "contentful-management";
4854
- var ListConceptsToolParams = z73.object({
4855
- organizationId: z73.string().describe("The ID of the Contentful organization"),
4856
- conceptId: z73.string().optional().describe("The ID of the concept (required for descendants/ancestors)"),
4857
- limit: z73.number().optional().describe("Maximum number of concepts to return"),
4858
- select: z73.string().optional().describe("Comma-separated list of fields to return"),
4859
- include: z73.number().optional().describe("Include this many levels of linked entries"),
4860
- order: z73.string().optional().describe("Order concepts by this field"),
4861
- getDescendants: z73.boolean().optional().describe("Get descendants of the specified concept (requires conceptId)"),
4862
- getAncestors: z73.boolean().optional().describe("Get ancestors of the specified concept (requires conceptId)"),
4863
- getTotalOnly: z73.boolean().optional().describe("Get only the total number of concepts without full data")
4991
+ var ListConceptsToolParams = z76.object({
4992
+ organizationId: z76.string().describe("The ID of the Contentful organization"),
4993
+ conceptId: z76.string().optional().describe("The ID of the concept (required for descendants/ancestors)"),
4994
+ limit: z76.number().optional().describe("Maximum number of concepts to return"),
4995
+ select: z76.string().optional().describe("Comma-separated list of fields to return"),
4996
+ include: z76.number().optional().describe("Include this many levels of linked entries"),
4997
+ order: z76.string().optional().describe("Order concepts by this field"),
4998
+ getDescendants: z76.boolean().optional().describe("Get descendants of the specified concept (requires conceptId)"),
4999
+ getAncestors: z76.boolean().optional().describe("Get ancestors of the specified concept (requires conceptId)"),
5000
+ getTotalOnly: z76.boolean().optional().describe("Get only the total number of concepts without full data")
4864
5001
  });
4865
5002
  function listConceptsTool(config) {
4866
5003
  async function tool2(args) {
@@ -5036,54 +5173,54 @@ function createTaxonomyTools(config) {
5036
5173
  }
5037
5174
 
5038
5175
  // src/tools/jobs/space-to-space-migration/exportSpace.ts
5039
- import { z as z75 } from "zod";
5176
+ import { z as z78 } from "zod";
5040
5177
 
5041
5178
  // src/types/querySchema.ts
5042
- import { z as z74 } from "zod";
5043
- var EntryQuerySchema = z74.object({
5044
- content_type: z74.string().optional().describe("Filter by content type"),
5045
- include: z74.number().optional().describe("Include this many levels of linked entries"),
5046
- select: z74.string().optional().describe("Comma-separated list of fields to return"),
5047
- links_to_entry: z74.string().optional().describe("Find entries that link to the specified entry ID"),
5048
- limit: z74.number().optional().describe("Maximum number of entries to return"),
5049
- skip: z74.number().optional().describe("Skip this many entries"),
5050
- order: z74.string().optional().describe("Order entries by this field")
5179
+ import { z as z77 } from "zod";
5180
+ var EntryQuerySchema = z77.object({
5181
+ content_type: z77.string().optional().describe("Filter by content type"),
5182
+ include: z77.number().optional().describe("Include this many levels of linked entries"),
5183
+ select: z77.string().optional().describe("Comma-separated list of fields to return"),
5184
+ links_to_entry: z77.string().optional().describe("Find entries that link to the specified entry ID"),
5185
+ limit: z77.number().optional().describe("Maximum number of entries to return"),
5186
+ skip: z77.number().optional().describe("Skip this many entries"),
5187
+ order: z77.string().optional().describe("Order entries by this field")
5051
5188
  });
5052
- var AssetQuerySchema = z74.object({
5053
- mimetype_group: z74.string().optional().describe("Filter by MIME type group"),
5054
- select: z74.string().optional().describe("Comma-separated list of fields to return"),
5055
- limit: z74.number().optional().describe("Maximum number of assets to return"),
5056
- skip: z74.number().optional().describe("Skip this many assets"),
5057
- order: z74.string().optional().describe("Order assets by this field")
5189
+ var AssetQuerySchema = z77.object({
5190
+ mimetype_group: z77.string().optional().describe("Filter by MIME type group"),
5191
+ select: z77.string().optional().describe("Comma-separated list of fields to return"),
5192
+ limit: z77.number().optional().describe("Maximum number of assets to return"),
5193
+ skip: z77.number().optional().describe("Skip this many assets"),
5194
+ order: z77.string().optional().describe("Order assets by this field")
5058
5195
  });
5059
5196
 
5060
5197
  // src/tools/jobs/space-to-space-migration/exportSpace.ts
5061
5198
  var ExportSpaceToolParams = BaseToolSchema.extend({
5062
- exportDir: z75.string().optional().describe(
5199
+ exportDir: z78.string().optional().describe(
5063
5200
  "Directory to save the exported space data (optional, defaults to current directory)"
5064
5201
  ),
5065
- saveFile: z75.boolean().optional().default(true).describe("Save the exported space data to a file"),
5066
- contentFile: z75.string().optional().describe("Custom filename for the exported space data (optional)"),
5067
- includeDrafts: z75.boolean().optional().default(false).describe("Include draft entries in the export"),
5068
- includeArchived: z75.boolean().optional().default(false).describe("Include archived entries in the export"),
5069
- skipContentModel: z75.boolean().optional().default(false).describe("Skip exporting content types"),
5070
- skipEditorInterfaces: z75.boolean().optional().default(false).describe("Skip exporting editor interfaces"),
5071
- skipContent: z75.boolean().optional().default(false).describe("Skip exporting entries and assets"),
5072
- skipRoles: z75.boolean().optional().default(false).describe("Skip exporting roles and permissions"),
5073
- skipTags: z75.boolean().optional().default(false).describe("Skip exporting tags"),
5074
- skipWebhooks: z75.boolean().optional().default(false).describe("Skip exporting webhooks"),
5075
- stripTags: z75.boolean().optional().default(false).describe("Untag assets and entries"),
5076
- contentOnly: z75.boolean().optional().default(false).describe("Only export assets and entries"),
5202
+ saveFile: z78.boolean().optional().default(true).describe("Save the exported space data to a file"),
5203
+ contentFile: z78.string().optional().describe("Custom filename for the exported space data (optional)"),
5204
+ includeDrafts: z78.boolean().optional().default(false).describe("Include draft entries in the export"),
5205
+ includeArchived: z78.boolean().optional().default(false).describe("Include archived entries in the export"),
5206
+ skipContentModel: z78.boolean().optional().default(false).describe("Skip exporting content types"),
5207
+ skipEditorInterfaces: z78.boolean().optional().default(false).describe("Skip exporting editor interfaces"),
5208
+ skipContent: z78.boolean().optional().default(false).describe("Skip exporting entries and assets"),
5209
+ skipRoles: z78.boolean().optional().default(false).describe("Skip exporting roles and permissions"),
5210
+ skipTags: z78.boolean().optional().default(false).describe("Skip exporting tags"),
5211
+ skipWebhooks: z78.boolean().optional().default(false).describe("Skip exporting webhooks"),
5212
+ stripTags: z78.boolean().optional().default(false).describe("Untag assets and entries"),
5213
+ contentOnly: z78.boolean().optional().default(false).describe("Only export assets and entries"),
5077
5214
  queryEntries: EntryQuerySchema.optional().describe(
5078
5215
  "Export only entries that match query parameters"
5079
5216
  ),
5080
5217
  queryAssets: AssetQuerySchema.optional().describe(
5081
5218
  "Export only assets that match query parameters"
5082
5219
  ),
5083
- downloadAssets: z75.boolean().optional().default(false).describe("Download actual asset files"),
5084
- maxAllowedLimit: z75.number().optional().default(1e3).describe("Maximum number of items per request"),
5085
- errorLogFile: z75.string().optional().describe("Path to error log output file"),
5086
- useVerboseRenderer: z75.boolean().optional().describe("Line-by-line logging, useful for CI")
5220
+ downloadAssets: z78.boolean().optional().default(false).describe("Download actual asset files"),
5221
+ maxAllowedLimit: z78.number().optional().default(1e3).describe("Maximum number of items per request"),
5222
+ errorLogFile: z78.string().optional().describe("Path to error log output file"),
5223
+ useVerboseRenderer: z78.boolean().optional().describe("Line-by-line logging, useful for CI")
5087
5224
  });
5088
5225
  function createExportSpaceTool(config) {
5089
5226
  async function tool2(args) {
@@ -5133,70 +5270,70 @@ function createExportSpaceTool(config) {
5133
5270
  }
5134
5271
 
5135
5272
  // src/tools/jobs/space-to-space-migration/paramCollection.ts
5136
- import { z as z76 } from "zod";
5273
+ import { z as z79 } from "zod";
5137
5274
  var ParamCollectionToolParams = BaseToolSchema.extend({
5138
- confirmation: z76.boolean().optional().describe(
5275
+ confirmation: z79.boolean().optional().describe(
5139
5276
  "User confirmation that they are ready to proceed with the workflow"
5140
5277
  ),
5141
- export: z76.object({
5142
- spaceId: z76.string().optional().describe("ID of the space with source data"),
5143
- environmentId: z76.string().optional().describe("ID of the environment in the source space"),
5144
- deliveryToken: z76.string().optional().describe("CDA token to export only published content (excludes tags)"),
5145
- exportDir: z76.string().optional().describe("Path to export JSON output"),
5146
- saveFile: z76.boolean().optional().describe("Save the export as a JSON file"),
5147
- contentFile: z76.string().optional().describe("Filename for exported data"),
5148
- includeDrafts: z76.boolean().optional().describe("Include drafts in exported entries"),
5149
- includeArchived: z76.boolean().optional().describe("Include archived entries"),
5150
- skipContentModel: z76.boolean().optional().describe("Skip exporting content models"),
5151
- skipEditorInterfaces: z76.boolean().optional().describe("Skip exporting editor interfaces"),
5152
- skipContent: z76.boolean().optional().describe("Skip exporting entries and assets"),
5153
- skipRoles: z76.boolean().optional().describe("Skip exporting roles and permissions"),
5154
- skipTags: z76.boolean().optional().describe("Skip exporting tags"),
5155
- skipWebhooks: z76.boolean().optional().describe("Skip exporting webhooks"),
5156
- stripTags: z76.boolean().optional().describe("Remove tags from entries and assets"),
5157
- contentOnly: z76.boolean().optional().describe("Export only entries and assets"),
5278
+ export: z79.object({
5279
+ spaceId: z79.string().optional().describe("ID of the space with source data"),
5280
+ environmentId: z79.string().optional().describe("ID of the environment in the source space"),
5281
+ deliveryToken: z79.string().optional().describe("CDA token to export only published content (excludes tags)"),
5282
+ exportDir: z79.string().optional().describe("Path to export JSON output"),
5283
+ saveFile: z79.boolean().optional().describe("Save the export as a JSON file"),
5284
+ contentFile: z79.string().optional().describe("Filename for exported data"),
5285
+ includeDrafts: z79.boolean().optional().describe("Include drafts in exported entries"),
5286
+ includeArchived: z79.boolean().optional().describe("Include archived entries"),
5287
+ skipContentModel: z79.boolean().optional().describe("Skip exporting content models"),
5288
+ skipEditorInterfaces: z79.boolean().optional().describe("Skip exporting editor interfaces"),
5289
+ skipContent: z79.boolean().optional().describe("Skip exporting entries and assets"),
5290
+ skipRoles: z79.boolean().optional().describe("Skip exporting roles and permissions"),
5291
+ skipTags: z79.boolean().optional().describe("Skip exporting tags"),
5292
+ skipWebhooks: z79.boolean().optional().describe("Skip exporting webhooks"),
5293
+ stripTags: z79.boolean().optional().describe("Remove tags from entries and assets"),
5294
+ contentOnly: z79.boolean().optional().describe("Export only entries and assets"),
5158
5295
  queryEntries: EntryQuerySchema.optional().describe(
5159
5296
  "Export only entries that match query parameters"
5160
5297
  ),
5161
5298
  queryAssets: AssetQuerySchema.optional().describe(
5162
5299
  "Export only assets that match query parameters"
5163
5300
  ),
5164
- downloadAssets: z76.boolean().optional().describe("Download asset files to disk"),
5165
- host: z76.string().optional().describe("Management API host"),
5166
- hostDelivery: z76.string().optional().describe("Delivery API host"),
5167
- proxy: z76.string().optional().describe("HTTP/HTTPS proxy config"),
5168
- rawProxy: z76.boolean().optional().describe("Pass raw proxy config directly to Axios"),
5169
- maxAllowedLimit: z76.number().optional().describe("Page size for requests"),
5170
- headers: z76.record(z76.any()).optional().describe("Additional headers to include in requests"),
5171
- errorLogFile: z76.string().optional().describe("Path to error log output file"),
5172
- useVerboseRenderer: z76.boolean().optional().describe("Line-by-line logging, useful for CI"),
5173
- config: z76.string().optional().describe("Path to a JSON config file with all options")
5301
+ downloadAssets: z79.boolean().optional().describe("Download asset files to disk"),
5302
+ host: z79.string().optional().describe("Management API host"),
5303
+ hostDelivery: z79.string().optional().describe("Delivery API host"),
5304
+ proxy: z79.string().optional().describe("HTTP/HTTPS proxy config"),
5305
+ rawProxy: z79.boolean().optional().describe("Pass raw proxy config directly to Axios"),
5306
+ maxAllowedLimit: z79.number().optional().describe("Page size for requests"),
5307
+ headers: z79.record(z79.any()).optional().describe("Additional headers to include in requests"),
5308
+ errorLogFile: z79.string().optional().describe("Path to error log output file"),
5309
+ useVerboseRenderer: z79.boolean().optional().describe("Line-by-line logging, useful for CI"),
5310
+ config: z79.string().optional().describe("Path to a JSON config file with all options")
5174
5311
  }).optional(),
5175
- import: z76.object({
5176
- spaceId: z76.string().optional().describe("ID of the space to import into"),
5177
- environmentId: z76.string().optional().describe("Target environment in destination space"),
5178
- contentFile: z76.string().optional().describe("Path to JSON file containing the content to import"),
5179
- content: z76.record(z76.any()).optional().describe(
5312
+ import: z79.object({
5313
+ spaceId: z79.string().optional().describe("ID of the space to import into"),
5314
+ environmentId: z79.string().optional().describe("Target environment in destination space"),
5315
+ contentFile: z79.string().optional().describe("Path to JSON file containing the content to import"),
5316
+ content: z79.record(z79.any()).optional().describe(
5180
5317
  "JS object containing import content (must match expected structure)"
5181
5318
  ),
5182
- contentModelOnly: z76.boolean().optional().describe("Import only content types"),
5183
- skipContentModel: z76.boolean().optional().describe("Skip importing content types and locales"),
5184
- skipLocales: z76.boolean().optional().describe("Skip importing locales"),
5185
- skipContentUpdates: z76.boolean().optional().describe("Do not update existing content"),
5186
- skipContentPublishing: z76.boolean().optional().describe("Create but do not publish content"),
5187
- uploadAssets: z76.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
5188
- skipAssetUpdates: z76.boolean().optional().describe("Do not update existing assets"),
5189
- assetsDirectory: z76.string().optional().describe("Path to directory containing exported asset files"),
5190
- timeout: z76.number().optional().describe("Time between retries during asset processing (ms)"),
5191
- retryLimit: z76.number().optional().describe("Max retries for asset processing"),
5192
- host: z76.string().optional().describe("Management API host"),
5193
- proxy: z76.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
5194
- rawProxy: z76.boolean().optional().describe("Pass proxy config directly to Axios"),
5195
- rateLimit: z76.number().optional().describe("Max requests per second to the API"),
5196
- headers: z76.record(z76.any()).optional().describe("Additional headers to attach to requests"),
5197
- errorLogFile: z76.string().optional().describe("Path to error log file"),
5198
- useVerboseRenderer: z76.boolean().optional().describe("Line-by-line progress output (good for CI)"),
5199
- config: z76.string().optional().describe("Path to config JSON file (merged with CLI args)")
5319
+ contentModelOnly: z79.boolean().optional().describe("Import only content types"),
5320
+ skipContentModel: z79.boolean().optional().describe("Skip importing content types and locales"),
5321
+ skipLocales: z79.boolean().optional().describe("Skip importing locales"),
5322
+ skipContentUpdates: z79.boolean().optional().describe("Do not update existing content"),
5323
+ skipContentPublishing: z79.boolean().optional().describe("Create but do not publish content"),
5324
+ uploadAssets: z79.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
5325
+ skipAssetUpdates: z79.boolean().optional().describe("Do not update existing assets"),
5326
+ assetsDirectory: z79.string().optional().describe("Path to directory containing exported asset files"),
5327
+ timeout: z79.number().optional().describe("Time between retries during asset processing (ms)"),
5328
+ retryLimit: z79.number().optional().describe("Max retries for asset processing"),
5329
+ host: z79.string().optional().describe("Management API host"),
5330
+ proxy: z79.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
5331
+ rawProxy: z79.boolean().optional().describe("Pass proxy config directly to Axios"),
5332
+ rateLimit: z79.number().optional().describe("Max requests per second to the API"),
5333
+ headers: z79.record(z79.any()).optional().describe("Additional headers to attach to requests"),
5334
+ errorLogFile: z79.string().optional().describe("Path to error log file"),
5335
+ useVerboseRenderer: z79.boolean().optional().describe("Line-by-line progress output (good for CI)"),
5336
+ config: z79.string().optional().describe("Path to config JSON file (merged with CLI args)")
5200
5337
  }).optional()
5201
5338
  });
5202
5339
  var paramCollectionConfig = {
@@ -5312,25 +5449,25 @@ var createParamCollectionTool = withErrorHandling(
5312
5449
  );
5313
5450
 
5314
5451
  // src/tools/jobs/space-to-space-migration/importSpace.ts
5315
- import { z as z77 } from "zod";
5452
+ import { z as z80 } from "zod";
5316
5453
  var ImportSpaceToolParams = BaseToolSchema.extend({
5317
- contentFile: z77.string().optional().describe("Path to JSON file containing the content to import"),
5318
- content: z77.record(z77.any()).optional().describe(
5454
+ contentFile: z80.string().optional().describe("Path to JSON file containing the content to import"),
5455
+ content: z80.record(z80.any()).optional().describe(
5319
5456
  "JS object containing import content (must match expected structure)"
5320
5457
  ),
5321
- contentModelOnly: z77.boolean().optional().default(false).describe("Import only content types"),
5322
- skipContentModel: z77.boolean().optional().default(false).describe("Skip importing content types and locales"),
5323
- skipLocales: z77.boolean().optional().default(false).describe("Skip importing locales"),
5324
- skipContentUpdates: z77.boolean().optional().default(false).describe("Do not update existing content"),
5325
- skipContentPublishing: z77.boolean().optional().default(false).describe("Create but do not publish content"),
5326
- uploadAssets: z77.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
5327
- skipAssetUpdates: z77.boolean().optional().default(false).describe("Do not update existing assets"),
5328
- assetsDirectory: z77.string().optional().describe("Path to directory containing exported asset files"),
5329
- timeout: z77.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
5330
- retryLimit: z77.number().optional().default(10).describe("Max retries for asset processing"),
5331
- rateLimit: z77.number().optional().default(7).describe("Max requests per second to the API"),
5332
- errorLogFile: z77.string().optional().describe("Path to error log file"),
5333
- useVerboseRenderer: z77.boolean().optional().describe("Line-by-line progress output (good for CI)")
5458
+ contentModelOnly: z80.boolean().optional().default(false).describe("Import only content types"),
5459
+ skipContentModel: z80.boolean().optional().default(false).describe("Skip importing content types and locales"),
5460
+ skipLocales: z80.boolean().optional().default(false).describe("Skip importing locales"),
5461
+ skipContentUpdates: z80.boolean().optional().default(false).describe("Do not update existing content"),
5462
+ skipContentPublishing: z80.boolean().optional().default(false).describe("Create but do not publish content"),
5463
+ uploadAssets: z80.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
5464
+ skipAssetUpdates: z80.boolean().optional().default(false).describe("Do not update existing assets"),
5465
+ assetsDirectory: z80.string().optional().describe("Path to directory containing exported asset files"),
5466
+ timeout: z80.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
5467
+ retryLimit: z80.number().optional().default(10).describe("Max retries for asset processing"),
5468
+ rateLimit: z80.number().optional().default(7).describe("Max requests per second to the API"),
5469
+ errorLogFile: z80.string().optional().describe("Path to error log file"),
5470
+ useVerboseRenderer: z80.boolean().optional().describe("Line-by-line progress output (good for CI)")
5334
5471
  });
5335
5472
  function createImportSpaceTool(config) {
5336
5473
  async function tool2(args) {
@@ -5375,7 +5512,7 @@ function createImportSpaceTool(config) {
5375
5512
  }
5376
5513
 
5377
5514
  // src/tools/jobs/space-to-space-migration/migrationHandler.ts
5378
- import { z as z78 } from "zod";
5515
+ import { z as z81 } from "zod";
5379
5516
 
5380
5517
  // src/tools/jobs/space-to-space-migration/instructions.ts
5381
5518
  var S2S_MIGRATION_INSTRUCTIONS = `
@@ -5418,7 +5555,7 @@ The space to space migration workflow has been concluded and all related tools h
5418
5555
  The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
5419
5556
  `;
5420
5557
  var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
5421
- enableWorkflow: z78.boolean().describe(
5558
+ enableWorkflow: z81.boolean().describe(
5422
5559
  "Set to true to enable the workflow tools, false to disable them and conclude the workflow"
5423
5560
  )
5424
5561
  });