@contentful/mcp-tools 0.4.1 → 0.4.4

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.
Files changed (2) hide show
  1. package/dist/index.js +31 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -642,7 +642,7 @@ function createAiActionTools(config) {
642
642
  inputParams: PublishAiActionToolParams.shape,
643
643
  annotations: {
644
644
  readOnlyHint: false,
645
- destructiveHint: false,
645
+ destructiveHint: true,
646
646
  idempotentHint: true,
647
647
  // Publishing same item multiple times has same effect
648
648
  openWorldHint: false
@@ -655,7 +655,7 @@ function createAiActionTools(config) {
655
655
  inputParams: UnpublishAiActionToolParams.shape,
656
656
  annotations: {
657
657
  readOnlyHint: false,
658
- destructiveHint: false,
658
+ destructiveHint: true,
659
659
  idempotentHint: true,
660
660
  // Unpublishing same item multiple times has same effect
661
661
  openWorldHint: false
@@ -1348,7 +1348,7 @@ function createAssetTools(config) {
1348
1348
  inputParams: PublishAssetToolParams.shape,
1349
1349
  annotations: {
1350
1350
  readOnlyHint: false,
1351
- destructiveHint: false,
1351
+ destructiveHint: true,
1352
1352
  idempotentHint: true,
1353
1353
  openWorldHint: false
1354
1354
  },
@@ -1360,7 +1360,7 @@ function createAssetTools(config) {
1360
1360
  inputParams: UnpublishAssetToolParams.shape,
1361
1361
  annotations: {
1362
1362
  readOnlyHint: false,
1363
- destructiveHint: false,
1363
+ destructiveHint: true,
1364
1364
  idempotentHint: true,
1365
1365
  openWorldHint: false
1366
1366
  },
@@ -1372,7 +1372,7 @@ function createAssetTools(config) {
1372
1372
  inputParams: ArchiveAssetToolParams.shape,
1373
1373
  annotations: {
1374
1374
  readOnlyHint: false,
1375
- destructiveHint: false,
1375
+ destructiveHint: true,
1376
1376
  idempotentHint: true,
1377
1377
  openWorldHint: false
1378
1378
  },
@@ -1800,7 +1800,7 @@ function createContentTypeTools(config) {
1800
1800
  inputParams: PublishContentTypeToolParams.shape,
1801
1801
  annotations: {
1802
1802
  readOnlyHint: false,
1803
- destructiveHint: false,
1803
+ destructiveHint: true,
1804
1804
  idempotentHint: true,
1805
1805
  openWorldHint: false
1806
1806
  },
@@ -1812,7 +1812,7 @@ function createContentTypeTools(config) {
1812
1812
  inputParams: UnpublishContentTypeToolParams.shape,
1813
1813
  annotations: {
1814
1814
  readOnlyHint: false,
1815
- destructiveHint: false,
1815
+ destructiveHint: true,
1816
1816
  idempotentHint: true,
1817
1817
  openWorldHint: false
1818
1818
  },
@@ -2190,6 +2190,20 @@ function searchLimit(userLimit) {
2190
2190
  return Math.min(userLimit || 10, 1e3);
2191
2191
  }
2192
2192
 
2193
+ // src/utils/queryParams.ts
2194
+ function normalizeArrayFilters(query) {
2195
+ const normalized = {};
2196
+ let didConvert = false;
2197
+ for (const key of Object.keys(query)) {
2198
+ const value = query[key];
2199
+ if (Array.isArray(value)) {
2200
+ normalized[key] = value.join(",");
2201
+ didConvert = true;
2202
+ }
2203
+ }
2204
+ return didConvert ? { ...query, ...normalized } : query;
2205
+ }
2206
+
2193
2207
  // src/tools/entries/searchEntries.ts
2194
2208
  var SearchEntriesToolParams = BaseToolSchema.extend({
2195
2209
  query: z35.object({
@@ -2236,11 +2250,11 @@ function searchEntriesTool(config) {
2236
2250
  const contentfulClient = createToolClient(config, args);
2237
2251
  const entries = await contentfulClient.entry.getMany({
2238
2252
  ...params,
2239
- query: {
2253
+ query: normalizeArrayFilters({
2240
2254
  ...args.query,
2241
2255
  limit: searchLimit(args.query.limit),
2242
2256
  skip: args.query.skip || 0
2243
- }
2257
+ })
2244
2258
  });
2245
2259
  const summarized = summarizeData(entries, {
2246
2260
  maxItems: searchLimit(args.query.limit),
@@ -2891,7 +2905,7 @@ function createEntryTools(config) {
2891
2905
  inputParams: PublishEntryToolParams.shape,
2892
2906
  annotations: {
2893
2907
  readOnlyHint: false,
2894
- destructiveHint: false,
2908
+ destructiveHint: true,
2895
2909
  idempotentHint: true,
2896
2910
  openWorldHint: false
2897
2911
  },
@@ -2903,7 +2917,7 @@ function createEntryTools(config) {
2903
2917
  inputParams: UnpublishEntryToolParams.shape,
2904
2918
  annotations: {
2905
2919
  readOnlyHint: false,
2906
- destructiveHint: false,
2920
+ destructiveHint: true,
2907
2921
  idempotentHint: true,
2908
2922
  openWorldHint: false
2909
2923
  },
@@ -2915,7 +2929,7 @@ function createEntryTools(config) {
2915
2929
  inputParams: ArchiveEntryToolParams.shape,
2916
2930
  annotations: {
2917
2931
  readOnlyHint: false,
2918
- destructiveHint: false,
2932
+ destructiveHint: true,
2919
2933
  idempotentHint: true,
2920
2934
  openWorldHint: false
2921
2935
  },
@@ -2951,12 +2965,14 @@ function createEnvironmentTool(config) {
2951
2965
  const environment = await contentfulClient.environment.createWithId(
2952
2966
  {
2953
2967
  spaceId: args.spaceId,
2954
- environmentId: args.environmentId
2968
+ environmentId: args.environmentId,
2969
+ ...args.sourceEnvironmentId && {
2970
+ sourceEnvironmentId: args.sourceEnvironmentId
2971
+ }
2955
2972
  },
2956
2973
  {
2957
2974
  name: args.name
2958
- },
2959
- args.sourceEnvironmentId ? { "X-Contentful-Source-Environment": args.sourceEnvironmentId } : void 0
2975
+ }
2960
2976
  );
2961
2977
  return createSuccessResponse("Environment created successfully", {
2962
2978
  environment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/mcp-tools",
3
- "version": "0.4.1",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",