@contentful/mcp-tools 0.12.13 → 0.12.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -134,6 +134,10 @@ Each tool includes semantic annotations to help MCP clients understand tool beha
134
134
  | | `validate_release` | Validate a release, optionally against publish/unpublish |
135
135
  | | `get_release_action` | Check the status of a queued release action |
136
136
  | | `list_release_actions` | List release actions (max 10 per request) |
137
+ | | `schedule_publish_release` | Schedule a release to publish at a future datetime (or reschedule) |
138
+ | | `schedule_unpublish_release` | Schedule a release to unpublish at a future datetime (or reschedule) |
139
+ | | `cancel_scheduled_release` | Cancel a scheduled release action (two-phase confirm) |
140
+ | | `list_scheduled_actions` | List scheduled actions (max 10 per request) |
137
141
  | **AI Actions** | `create_ai_action` | Create custom AI-powered workflows |
138
142
  | | `invoke_ai_action` | Invoke AI action with variables (bulk support) |
139
143
  | | `get_ai_action_invocation` | Get AI action invocation details |
package/dist/index.d.ts CHANGED
@@ -4238,7 +4238,7 @@ declare class ContentfulMcpTools {
4238
4238
  componentId: zod.ZodOptional<zod.ZodString>;
4239
4239
  name: zod.ZodString;
4240
4240
  description: zod.ZodString;
4241
- viewports: zod.ZodArray<zod.ZodObject<{
4241
+ viewports: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
4242
4242
  id: zod.ZodString;
4243
4243
  query: zod.ZodString;
4244
4244
  displayName: zod.ZodString;
@@ -4253,7 +4253,7 @@ declare class ContentfulMcpTools {
4253
4253
  query: string;
4254
4254
  displayName: string;
4255
4255
  previewSize: string;
4256
- }>, "many">;
4256
+ }>, "many">>;
4257
4257
  contentProperties: zod.ZodArray<zod.ZodIntersection<zod.ZodType<contentful_management.DataTypeDefinition, zod.ZodTypeDef, contentful_management.DataTypeDefinition>, zod.ZodObject<{
4258
4258
  id: zod.ZodString;
4259
4259
  name: zod.ZodString;
@@ -4636,12 +4636,6 @@ declare class ContentfulMcpTools {
4636
4636
  id: string;
4637
4637
  defaultValue?: unknown;
4638
4638
  })[];
4639
- viewports: {
4640
- id: string;
4641
- query: string;
4642
- displayName: string;
4643
- previewSize: string;
4644
- }[];
4645
4639
  metadata?: {
4646
4640
  tags?: {
4647
4641
  sys: {
@@ -4675,6 +4669,12 @@ declare class ContentfulMcpTools {
4675
4669
  allowedTypes: string[];
4676
4670
  }[] | undefined;
4677
4671
  }[] | undefined;
4672
+ viewports?: {
4673
+ id: string;
4674
+ query: string;
4675
+ displayName: string;
4676
+ previewSize: string;
4677
+ }[] | undefined;
4678
4678
  componentTree?: contentful_management.TreeNodeV2[] | undefined;
4679
4679
  }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
4680
4680
  };
@@ -5261,7 +5261,7 @@ declare class ContentfulMcpTools {
5261
5261
  } & {
5262
5262
  name: zod.ZodString;
5263
5263
  description: zod.ZodString;
5264
- viewports: zod.ZodArray<zod.ZodObject<{
5264
+ viewports: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
5265
5265
  id: zod.ZodString;
5266
5266
  query: zod.ZodString;
5267
5267
  displayName: zod.ZodString;
@@ -5276,7 +5276,7 @@ declare class ContentfulMcpTools {
5276
5276
  query: string;
5277
5277
  displayName: string;
5278
5278
  previewSize: string;
5279
- }>, "many">;
5279
+ }>, "many">>;
5280
5280
  contentProperties: zod.ZodArray<zod.ZodIntersection<zod.ZodType<contentful_management.DataTypeDefinition, zod.ZodTypeDef, contentful_management.DataTypeDefinition>, zod.ZodObject<{
5281
5281
  id: zod.ZodString;
5282
5282
  name: zod.ZodString;
@@ -5659,12 +5659,6 @@ declare class ContentfulMcpTools {
5659
5659
  id: string;
5660
5660
  defaultValue?: unknown;
5661
5661
  })[];
5662
- viewports: {
5663
- id: string;
5664
- query: string;
5665
- displayName: string;
5666
- previewSize: string;
5667
- }[];
5668
5662
  metadata?: {
5669
5663
  tags?: {
5670
5664
  sys: {
@@ -5697,6 +5691,12 @@ declare class ContentfulMcpTools {
5697
5691
  allowedTypes: string[];
5698
5692
  }[] | undefined;
5699
5693
  }[] | undefined;
5694
+ viewports?: {
5695
+ id: string;
5696
+ query: string;
5697
+ displayName: string;
5698
+ previewSize: string;
5699
+ }[] | undefined;
5700
5700
  componentTree?: contentful_management.TreeNodeV2[] | undefined;
5701
5701
  }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
5702
5702
  };
@@ -6310,7 +6310,7 @@ declare class ContentfulMcpTools {
6310
6310
  urn: string;
6311
6311
  };
6312
6312
  }>;
6313
- viewports: zod.ZodArray<zod.ZodObject<{
6313
+ viewports: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
6314
6314
  id: zod.ZodString;
6315
6315
  query: zod.ZodString;
6316
6316
  displayName: zod.ZodString;
@@ -6325,8 +6325,8 @@ declare class ContentfulMcpTools {
6325
6325
  query: string;
6326
6326
  displayName: string;
6327
6327
  previewSize: string;
6328
- }>, "many">;
6329
- designProperties: zod.ZodRecord<zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
6328
+ }>, "many">>;
6329
+ designProperties: zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodObject<{
6330
6330
  type: zod.ZodLiteral<"ManualDesignValue">;
6331
6331
  value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
6332
6332
  }, "strip", zod.ZodTypeAny, {
@@ -6344,7 +6344,25 @@ declare class ContentfulMcpTools {
6344
6344
  }, {
6345
6345
  value: string;
6346
6346
  type: "DesignToken";
6347
- }>]>>>;
6347
+ }>]>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
6348
+ type: zod.ZodLiteral<"ManualDesignValue">;
6349
+ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
6350
+ }, "strip", zod.ZodTypeAny, {
6351
+ value: string | number | boolean;
6352
+ type: "ManualDesignValue";
6353
+ }, {
6354
+ value: string | number | boolean;
6355
+ type: "ManualDesignValue";
6356
+ }>, zod.ZodObject<{
6357
+ type: zod.ZodLiteral<"DesignToken">;
6358
+ value: zod.ZodString;
6359
+ }, "strip", zod.ZodTypeAny, {
6360
+ value: string;
6361
+ type: "DesignToken";
6362
+ }, {
6363
+ value: string;
6364
+ type: "DesignToken";
6365
+ }>]>>]>>;
6348
6366
  contentBindings: zod.ZodOptional<zod.ZodObject<{
6349
6367
  sys: zod.ZodObject<{
6350
6368
  type: zod.ZodLiteral<"ResourceLink">;
@@ -6523,19 +6541,19 @@ declare class ContentfulMcpTools {
6523
6541
  urn: string;
6524
6542
  };
6525
6543
  };
6526
- designProperties: Record<string, Record<string, {
6544
+ designProperties: Record<string, {
6545
+ value: string;
6546
+ type: "DesignToken";
6547
+ } | {
6548
+ value: string | number | boolean;
6549
+ type: "ManualDesignValue";
6550
+ } | Record<string, {
6527
6551
  value: string;
6528
6552
  type: "DesignToken";
6529
6553
  } | {
6530
6554
  value: string | number | boolean;
6531
6555
  type: "ManualDesignValue";
6532
6556
  }>>;
6533
- viewports: {
6534
- id: string;
6535
- query: string;
6536
- displayName: string;
6537
- previewSize: string;
6538
- }[];
6539
6557
  metadata?: {
6540
6558
  name?: string | undefined;
6541
6559
  tags?: {
@@ -6568,6 +6586,12 @@ declare class ContentfulMcpTools {
6568
6586
  };
6569
6587
  }>;
6570
6588
  } | undefined;
6589
+ viewports?: {
6590
+ id: string;
6591
+ query: string;
6592
+ displayName: string;
6593
+ previewSize: string;
6594
+ }[] | undefined;
6571
6595
  }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
6572
6596
  };
6573
6597
  upsertExperience: {
@@ -6597,7 +6621,25 @@ declare class ContentfulMcpTools {
6597
6621
  displayName: string;
6598
6622
  previewSize: string;
6599
6623
  }>, "many">>;
6600
- designProperties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
6624
+ designProperties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodObject<{
6625
+ type: zod.ZodLiteral<"ManualDesignValue">;
6626
+ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
6627
+ }, "strip", zod.ZodTypeAny, {
6628
+ value: string | number | boolean;
6629
+ type: "ManualDesignValue";
6630
+ }, {
6631
+ value: string | number | boolean;
6632
+ type: "ManualDesignValue";
6633
+ }>, zod.ZodObject<{
6634
+ type: zod.ZodLiteral<"DesignToken">;
6635
+ value: zod.ZodString;
6636
+ }, "strip", zod.ZodTypeAny, {
6637
+ value: string;
6638
+ type: "DesignToken";
6639
+ }, {
6640
+ value: string;
6641
+ type: "DesignToken";
6642
+ }>]>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
6601
6643
  type: zod.ZodLiteral<"ManualDesignValue">;
6602
6644
  value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
6603
6645
  }, "strip", zod.ZodTypeAny, {
@@ -6615,7 +6657,7 @@ declare class ContentfulMcpTools {
6615
6657
  }, {
6616
6658
  value: string;
6617
6659
  type: "DesignToken";
6618
- }>]>>>>;
6660
+ }>]>>]>>>;
6619
6661
  contentBindings: zod.ZodOptional<zod.ZodObject<{
6620
6662
  sys: zod.ZodObject<{
6621
6663
  type: zod.ZodLiteral<"ResourceLink">;
@@ -6806,7 +6848,13 @@ declare class ContentfulMcpTools {
6806
6848
  }[] | undefined;
6807
6849
  } | undefined;
6808
6850
  description?: string | undefined;
6809
- designProperties?: Record<string, Record<string, {
6851
+ designProperties?: Record<string, {
6852
+ value: string;
6853
+ type: "DesignToken";
6854
+ } | {
6855
+ value: string | number | boolean;
6856
+ type: "ManualDesignValue";
6857
+ } | Record<string, {
6810
6858
  value: string;
6811
6859
  type: "DesignToken";
6812
6860
  } | {
@@ -8591,6 +8639,113 @@ declare class ContentfulMcpTools {
8591
8639
  action?: "publish" | "unpublish" | "validate" | undefined;
8592
8640
  }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
8593
8641
  };
8642
+ schedulePublishRelease: {
8643
+ title: string;
8644
+ description: string;
8645
+ inputParams: {
8646
+ spaceId: zod.ZodString;
8647
+ environmentId: zod.ZodString;
8648
+ } & {
8649
+ releaseId: zod.ZodString;
8650
+ datetime: zod.ZodString;
8651
+ timezone: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
8652
+ scheduledActionId: zod.ZodOptional<zod.ZodString>;
8653
+ };
8654
+ annotations: {
8655
+ readOnlyHint: boolean;
8656
+ destructiveHint: boolean;
8657
+ idempotentHint: boolean;
8658
+ openWorldHint: boolean;
8659
+ };
8660
+ tool: (params: {
8661
+ spaceId: string;
8662
+ environmentId: string;
8663
+ releaseId: string;
8664
+ datetime: string;
8665
+ timezone?: string | undefined;
8666
+ scheduledActionId?: string | undefined;
8667
+ }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
8668
+ };
8669
+ scheduleUnpublishRelease: {
8670
+ title: string;
8671
+ description: string;
8672
+ inputParams: {
8673
+ spaceId: zod.ZodString;
8674
+ environmentId: zod.ZodString;
8675
+ } & {
8676
+ releaseId: zod.ZodString;
8677
+ datetime: zod.ZodString;
8678
+ timezone: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
8679
+ scheduledActionId: zod.ZodOptional<zod.ZodString>;
8680
+ };
8681
+ annotations: {
8682
+ readOnlyHint: boolean;
8683
+ destructiveHint: boolean;
8684
+ idempotentHint: boolean;
8685
+ openWorldHint: boolean;
8686
+ };
8687
+ tool: (params: {
8688
+ spaceId: string;
8689
+ environmentId: string;
8690
+ releaseId: string;
8691
+ datetime: string;
8692
+ timezone?: string | undefined;
8693
+ scheduledActionId?: string | undefined;
8694
+ }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
8695
+ };
8696
+ cancelScheduledRelease: {
8697
+ title: string;
8698
+ description: string;
8699
+ inputParams: {
8700
+ spaceId: zod.ZodString;
8701
+ environmentId: zod.ZodString;
8702
+ } & {
8703
+ releaseId: zod.ZodString;
8704
+ scheduledActionId: zod.ZodString;
8705
+ confirm: zod.ZodOptional<zod.ZodBoolean>;
8706
+ confirmToken: zod.ZodOptional<zod.ZodString>;
8707
+ };
8708
+ annotations: {
8709
+ readOnlyHint: boolean;
8710
+ destructiveHint: boolean;
8711
+ idempotentHint: boolean;
8712
+ openWorldHint: boolean;
8713
+ };
8714
+ tool: (params: {
8715
+ spaceId: string;
8716
+ environmentId: string;
8717
+ releaseId: string;
8718
+ scheduledActionId: string;
8719
+ confirmToken?: string | undefined;
8720
+ confirm?: boolean | undefined;
8721
+ }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
8722
+ };
8723
+ listScheduledActions: {
8724
+ title: string;
8725
+ description: string;
8726
+ inputParams: {
8727
+ spaceId: zod.ZodString;
8728
+ environmentId: zod.ZodString;
8729
+ } & {
8730
+ releaseId: zod.ZodOptional<zod.ZodString>;
8731
+ statusIn: zod.ZodOptional<zod.ZodString>;
8732
+ statusNin: zod.ZodOptional<zod.ZodString>;
8733
+ limit: zod.ZodOptional<zod.ZodNumber>;
8734
+ };
8735
+ annotations: {
8736
+ readOnlyHint: boolean;
8737
+ destructiveHint: boolean;
8738
+ openWorldHint: boolean;
8739
+ };
8740
+ tool: (params: {
8741
+ spaceId: string;
8742
+ environmentId: string;
8743
+ releaseId?: string | undefined;
8744
+ limit?: number | undefined;
8745
+ statusIn?: string | undefined;
8746
+ statusNin?: string | undefined;
8747
+ }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
8748
+ };
8594
8749
  };
8595
8750
  /**
8596
8751
  * Get tag tools
@@ -9297,7 +9452,7 @@ declare class ContentfulMcpTools {
9297
9452
  urn: string;
9298
9453
  };
9299
9454
  }>;
9300
- viewports: zod.ZodArray<zod.ZodObject<{
9455
+ viewports: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
9301
9456
  id: zod.ZodString;
9302
9457
  query: zod.ZodString;
9303
9458
  displayName: zod.ZodString;
@@ -9312,8 +9467,8 @@ declare class ContentfulMcpTools {
9312
9467
  query: string;
9313
9468
  displayName: string;
9314
9469
  previewSize: string;
9315
- }>, "many">;
9316
- designProperties: zod.ZodRecord<zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
9470
+ }>, "many">>;
9471
+ designProperties: zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodObject<{
9317
9472
  type: zod.ZodLiteral<"ManualDesignValue">;
9318
9473
  value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
9319
9474
  }, "strip", zod.ZodTypeAny, {
@@ -9331,7 +9486,25 @@ declare class ContentfulMcpTools {
9331
9486
  }, {
9332
9487
  value: string;
9333
9488
  type: "DesignToken";
9334
- }>]>>>;
9489
+ }>]>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
9490
+ type: zod.ZodLiteral<"ManualDesignValue">;
9491
+ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
9492
+ }, "strip", zod.ZodTypeAny, {
9493
+ value: string | number | boolean;
9494
+ type: "ManualDesignValue";
9495
+ }, {
9496
+ value: string | number | boolean;
9497
+ type: "ManualDesignValue";
9498
+ }>, zod.ZodObject<{
9499
+ type: zod.ZodLiteral<"DesignToken">;
9500
+ value: zod.ZodString;
9501
+ }, "strip", zod.ZodTypeAny, {
9502
+ value: string;
9503
+ type: "DesignToken";
9504
+ }, {
9505
+ value: string;
9506
+ type: "DesignToken";
9507
+ }>]>>]>>;
9335
9508
  contentBindings: zod.ZodOptional<zod.ZodObject<{
9336
9509
  sys: zod.ZodObject<{
9337
9510
  type: zod.ZodLiteral<"ResourceLink">;
@@ -9510,19 +9683,19 @@ declare class ContentfulMcpTools {
9510
9683
  urn: string;
9511
9684
  };
9512
9685
  };
9513
- designProperties: Record<string, Record<string, {
9686
+ designProperties: Record<string, {
9687
+ value: string;
9688
+ type: "DesignToken";
9689
+ } | {
9690
+ value: string | number | boolean;
9691
+ type: "ManualDesignValue";
9692
+ } | Record<string, {
9514
9693
  value: string;
9515
9694
  type: "DesignToken";
9516
9695
  } | {
9517
9696
  value: string | number | boolean;
9518
9697
  type: "ManualDesignValue";
9519
9698
  }>>;
9520
- viewports: {
9521
- id: string;
9522
- query: string;
9523
- displayName: string;
9524
- previewSize: string;
9525
- }[];
9526
9699
  metadata?: {
9527
9700
  name?: string | undefined;
9528
9701
  tags?: {
@@ -9555,6 +9728,12 @@ declare class ContentfulMcpTools {
9555
9728
  };
9556
9729
  }>;
9557
9730
  } | undefined;
9731
+ viewports?: {
9732
+ id: string;
9733
+ query: string;
9734
+ displayName: string;
9735
+ previewSize: string;
9736
+ }[] | undefined;
9558
9737
  }, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
9559
9738
  };
9560
9739
  updateExperienceFragment: {
@@ -9584,7 +9763,7 @@ declare class ContentfulMcpTools {
9584
9763
  displayName: string;
9585
9764
  previewSize: string;
9586
9765
  }>, "many">>;
9587
- designProperties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
9766
+ designProperties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodObject<{
9588
9767
  type: zod.ZodLiteral<"ManualDesignValue">;
9589
9768
  value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
9590
9769
  }, "strip", zod.ZodTypeAny, {
@@ -9602,7 +9781,25 @@ declare class ContentfulMcpTools {
9602
9781
  }, {
9603
9782
  value: string;
9604
9783
  type: "DesignToken";
9605
- }>]>>>>;
9784
+ }>]>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{
9785
+ type: zod.ZodLiteral<"ManualDesignValue">;
9786
+ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
9787
+ }, "strip", zod.ZodTypeAny, {
9788
+ value: string | number | boolean;
9789
+ type: "ManualDesignValue";
9790
+ }, {
9791
+ value: string | number | boolean;
9792
+ type: "ManualDesignValue";
9793
+ }>, zod.ZodObject<{
9794
+ type: zod.ZodLiteral<"DesignToken">;
9795
+ value: zod.ZodString;
9796
+ }, "strip", zod.ZodTypeAny, {
9797
+ value: string;
9798
+ type: "DesignToken";
9799
+ }, {
9800
+ value: string;
9801
+ type: "DesignToken";
9802
+ }>]>>]>>>;
9606
9803
  contentBindings: zod.ZodOptional<zod.ZodObject<{
9607
9804
  sys: zod.ZodObject<{
9608
9805
  type: zod.ZodLiteral<"ResourceLink">;
@@ -9793,7 +9990,13 @@ declare class ContentfulMcpTools {
9793
9990
  }[] | undefined;
9794
9991
  } | undefined;
9795
9992
  description?: string | undefined;
9796
- designProperties?: Record<string, Record<string, {
9993
+ designProperties?: Record<string, {
9994
+ value: string;
9995
+ type: "DesignToken";
9996
+ } | {
9997
+ value: string | number | boolean;
9998
+ type: "ManualDesignValue";
9999
+ } | Record<string, {
9797
10000
  value: string;
9798
10001
  type: "DesignToken";
9799
10002
  } | {
package/dist/index.js CHANGED
@@ -393,7 +393,8 @@ var RESOURCE_DISPLAY_NAME = {
393
393
  experienceTemplate: "experience template",
394
394
  dataAssembly: "data assembly",
395
395
  designToken: "design token",
396
- release: "release"
396
+ release: "release",
397
+ scheduledAction: "scheduled action"
397
398
  };
398
399
  function buildConfirmationPreview(resource, id, details, confirmToken) {
399
400
  const displayName = RESOURCE_DISPLAY_NAME[resource];
@@ -6499,6 +6500,14 @@ var ExperienceSlotNodeSchema = z87.lazy(
6499
6500
  () => z87.union([ExperienceFragmentNodeSchema, InlineExperienceFragmentNodeSchema])
6500
6501
  );
6501
6502
 
6503
+ // src/types/cmaViewportCompatibility.ts
6504
+ function asViewportOptionalCmaPayload(payload) {
6505
+ return payload;
6506
+ }
6507
+ function asViewportOptionalCmaPayloadWithFlattenedDesignProperties(payload) {
6508
+ return payload;
6509
+ }
6510
+
6502
6511
  // src/tools/exo/components/createComponent.ts
6503
6512
  var CreateComponentToolParams = BaseToolSchema.extend({
6504
6513
  componentId: z88.string().optional().describe(
@@ -6506,7 +6515,9 @@ var CreateComponentToolParams = BaseToolSchema.extend({
6506
6515
  ),
6507
6516
  name: z88.string().describe("The name of the component"),
6508
6517
  description: z88.string().describe("Description of the component"),
6509
- viewports: z88.array(ViewportSchema).describe("Viewport definitions for the component (may be empty)"),
6518
+ viewports: z88.array(ViewportSchema).optional().describe(
6519
+ "Optional viewport definitions for the component. Omit for viewport-free components."
6520
+ ),
6510
6521
  contentProperties: z88.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
6511
6522
  designProperties: z88.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
6512
6523
  componentTree: z88.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
@@ -6525,7 +6536,7 @@ function createComponentTool(config) {
6525
6536
  const componentData = {
6526
6537
  name: args.name,
6527
6538
  description: args.description,
6528
- viewports: args.viewports,
6539
+ ...args.viewports !== void 0 && { viewports: args.viewports },
6529
6540
  contentProperties: args.contentProperties,
6530
6541
  designProperties: args.designProperties,
6531
6542
  ...args.componentTree && { componentTree: args.componentTree },
@@ -6538,13 +6549,13 @@ function createComponentTool(config) {
6538
6549
  environmentId: args.environmentId,
6539
6550
  componentId: args.componentId
6540
6551
  },
6541
- {
6552
+ asViewportOptionalCmaPayload({
6542
6553
  sys: { id: args.componentId, type: "Component" },
6543
6554
  ...componentData
6544
- }
6555
+ })
6545
6556
  ) : await contentfulClient.component.create(
6546
6557
  { spaceId: args.spaceId, environmentId: args.environmentId },
6547
- componentData
6558
+ asViewportOptionalCmaPayload(componentData)
6548
6559
  );
6549
6560
  return createSuccessResponse("Component created successfully", {
6550
6561
  component
@@ -6589,7 +6600,8 @@ function upsertComponentTool(config) {
6589
6600
  `Version conflict: the component has changed since you read it (your version: ${args.version}, current version: ${current.sys.version}). Re-fetch the component with get_component and retry the update with the latest sys.version.`
6590
6601
  );
6591
6602
  }
6592
- const component = await contentfulClient.component.upsert(params, {
6603
+ const viewports = args.viewports ?? current.viewports;
6604
+ const componentData = {
6593
6605
  sys: {
6594
6606
  id: current.sys.id,
6595
6607
  type: "Component",
@@ -6597,14 +6609,18 @@ function upsertComponentTool(config) {
6597
6609
  },
6598
6610
  name: args.name ?? current.name,
6599
6611
  description: args.description ?? current.description,
6600
- viewports: args.viewports ?? current.viewports,
6612
+ ...viewports !== void 0 && { viewports },
6601
6613
  contentProperties: args.contentProperties ?? current.contentProperties,
6602
6614
  designProperties: args.designProperties ?? current.designProperties,
6603
6615
  ...args.componentTree ?? current.componentTree ? { componentTree: args.componentTree ?? current.componentTree } : {},
6604
6616
  ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
6605
6617
  ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {},
6606
6618
  ...current.dataAssemblies ? { dataAssemblies: current.dataAssemblies } : {}
6607
- });
6619
+ };
6620
+ const component = await contentfulClient.component.upsert(
6621
+ params,
6622
+ asViewportOptionalCmaPayload(componentData)
6623
+ );
6608
6624
  return createSuccessResponse("Component updated successfully", {
6609
6625
  component
6610
6626
  });
@@ -6892,8 +6908,16 @@ var CreateExperienceFragmentToolParams = BaseToolSchema.extend({
6892
6908
  component: ComponentResourceLinkSchema.describe(
6893
6909
  "Resource link to the component this experience fragment is based on"
6894
6910
  ),
6895
- viewports: z95.array(ViewportSchema).describe("Viewport definitions (may be empty)"),
6896
- designProperties: z95.record(z95.string(), DimensionedDesignPropertyValueSchema).describe(
6911
+ viewports: z95.array(ViewportSchema).optional().describe(
6912
+ "Optional viewport definitions for the experience fragment. Omit for viewport-free experience fragments."
6913
+ ),
6914
+ designProperties: z95.record(
6915
+ z95.string(),
6916
+ z95.union([
6917
+ DesignPropertyValueSchema,
6918
+ DimensionedDesignPropertyValueSchema
6919
+ ])
6920
+ ).describe(
6897
6921
  "Design property values keyed by property ID (may be empty object)"
6898
6922
  ),
6899
6923
  contentBindings: ExperienceContentBindingsSchema.optional().describe(
@@ -6911,18 +6935,21 @@ function createExperienceFragmentTool(config) {
6911
6935
  config.protectedEnvironments
6912
6936
  );
6913
6937
  const contentfulClient = createExoToolClient(config, args);
6938
+ const experienceFragmentData = {
6939
+ name: args.name,
6940
+ description: args.description,
6941
+ component: args.component,
6942
+ ...args.viewports !== void 0 && { viewports: args.viewports },
6943
+ designProperties: args.designProperties,
6944
+ ...args.contentBindings && { contentBindings: args.contentBindings },
6945
+ ...args.slots && { slots: args.slots },
6946
+ ...args.metadata && { metadata: args.metadata }
6947
+ };
6914
6948
  const experienceFragment = await contentfulClient.experienceFragment.create(
6915
6949
  { spaceId: args.spaceId, environmentId: args.environmentId },
6916
- {
6917
- name: args.name,
6918
- description: args.description,
6919
- component: args.component,
6920
- viewports: args.viewports,
6921
- designProperties: args.designProperties,
6922
- ...args.contentBindings && { contentBindings: args.contentBindings },
6923
- ...args.slots && { slots: args.slots },
6924
- ...args.metadata && { metadata: args.metadata }
6925
- }
6950
+ asViewportOptionalCmaPayloadWithFlattenedDesignProperties(
6951
+ experienceFragmentData
6952
+ )
6926
6953
  );
6927
6954
  return createSuccessResponse("Experience fragment created successfully", {
6928
6955
  experienceFragment
@@ -6941,7 +6968,13 @@ var UpdateExperienceFragmentToolParams = BaseToolSchema.extend({
6941
6968
  name: z96.string().optional().describe("The name of the experience fragment"),
6942
6969
  description: z96.string().optional().describe("Description of the experience fragment"),
6943
6970
  viewports: z96.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
6944
- designProperties: z96.record(z96.string(), DimensionedDesignPropertyValueSchema).optional().describe("Design property values; replaces existing if provided"),
6971
+ designProperties: z96.record(
6972
+ z96.string(),
6973
+ z96.union([
6974
+ DesignPropertyValueSchema,
6975
+ DimensionedDesignPropertyValueSchema
6976
+ ])
6977
+ ).optional().describe("Design property values; replaces existing if provided"),
6945
6978
  contentBindings: ExperienceContentBindingsSchema.optional().describe(
6946
6979
  "Content bindings; replaces existing if provided"
6947
6980
  ),
@@ -6968,22 +7001,26 @@ function updateExperienceFragmentTool(config) {
6968
7001
  `Version conflict: the experience fragment has changed since you read it (your version: ${args.version}, current version: ${current.sys.version}). Re-fetch the experience fragment with get_experience_fragment and retry the update with the latest sys.version.`
6969
7002
  );
6970
7003
  }
7004
+ const viewports = args.viewports ?? current.viewports;
7005
+ const experienceFragmentData = {
7006
+ sys: {
7007
+ id: current.sys.id,
7008
+ type: "ExperienceFragment",
7009
+ version: current.sys.version
7010
+ },
7011
+ name: args.name ?? current.name,
7012
+ description: args.description ?? current.description,
7013
+ ...viewports !== void 0 && { viewports },
7014
+ designProperties: args.designProperties ?? current.designProperties,
7015
+ ...args.contentBindings ?? current.contentBindings ? { contentBindings: args.contentBindings ?? current.contentBindings } : {},
7016
+ ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
7017
+ ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {}
7018
+ };
6971
7019
  const experienceFragment = await contentfulClient.experienceFragment.upsert(
6972
7020
  params,
6973
- {
6974
- sys: {
6975
- id: current.sys.id,
6976
- type: "ExperienceFragment",
6977
- version: current.sys.version
6978
- },
6979
- name: args.name ?? current.name,
6980
- description: args.description ?? current.description,
6981
- viewports: args.viewports ?? current.viewports,
6982
- designProperties: args.designProperties ?? current.designProperties,
6983
- ...args.contentBindings ?? current.contentBindings ? { contentBindings: args.contentBindings ?? current.contentBindings } : {},
6984
- ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
6985
- ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {}
6986
- }
7021
+ asViewportOptionalCmaPayloadWithFlattenedDesignProperties(
7022
+ experienceFragmentData
7023
+ )
6987
7024
  );
6988
7025
  return createSuccessResponse("Experience fragment updated successfully", {
6989
7026
  experienceFragment
@@ -7272,8 +7309,8 @@ import { z as z102 } from "zod";
7272
7309
  var CreateExperienceTemplateToolParams = BaseToolSchema.extend({
7273
7310
  name: z102.string().describe("The name of the experience template"),
7274
7311
  description: z102.string().describe("Description of the experience template"),
7275
- viewports: z102.array(ViewportSchema).describe(
7276
- "Viewport definitions for the experience template (may be empty)"
7312
+ viewports: z102.array(ViewportSchema).optional().describe(
7313
+ "Optional viewport definitions for the experience template. Omit for viewport-free experience templates."
7277
7314
  ),
7278
7315
  contentProperties: z102.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
7279
7316
  designProperties: z102.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
@@ -7290,18 +7327,19 @@ function createExperienceTemplateTool(config) {
7290
7327
  config.protectedEnvironments
7291
7328
  );
7292
7329
  const contentfulClient = createExoToolClient(config, args);
7330
+ const experienceTemplateData = {
7331
+ name: args.name,
7332
+ description: args.description,
7333
+ ...args.viewports !== void 0 && { viewports: args.viewports },
7334
+ contentProperties: args.contentProperties,
7335
+ designProperties: args.designProperties,
7336
+ ...args.componentTree && { componentTree: args.componentTree },
7337
+ ...args.slots && { slots: args.slots },
7338
+ ...args.metadata && { metadata: args.metadata }
7339
+ };
7293
7340
  const experienceTemplate = await contentfulClient.experienceTemplate.create(
7294
7341
  { spaceId: args.spaceId, environmentId: args.environmentId },
7295
- {
7296
- name: args.name,
7297
- description: args.description,
7298
- viewports: args.viewports,
7299
- contentProperties: args.contentProperties,
7300
- designProperties: args.designProperties,
7301
- ...args.componentTree && { componentTree: args.componentTree },
7302
- ...args.slots && { slots: args.slots },
7303
- ...args.metadata && { metadata: args.metadata }
7304
- }
7342
+ asViewportOptionalCmaPayload(experienceTemplateData)
7305
7343
  );
7306
7344
  return createSuccessResponse("Experience template created successfully", {
7307
7345
  experienceTemplate
@@ -7346,24 +7384,26 @@ function upsertExperienceTemplateTool(config) {
7346
7384
  `Version conflict: the experience template has changed since you read it (your version: ${args.version}, current version: ${current.sys.version}). Re-fetch the experience template with get_experience_template and retry the update with the latest sys.version.`
7347
7385
  );
7348
7386
  }
7387
+ const viewports = args.viewports ?? current.viewports;
7388
+ const experienceTemplateData = {
7389
+ sys: {
7390
+ id: current.sys.id,
7391
+ type: "ExperienceTemplate",
7392
+ version: current.sys.version
7393
+ },
7394
+ name: args.name ?? current.name,
7395
+ description: args.description ?? current.description,
7396
+ ...viewports !== void 0 && { viewports },
7397
+ contentProperties: args.contentProperties ?? current.contentProperties,
7398
+ designProperties: args.designProperties ?? current.designProperties,
7399
+ ...args.componentTree ?? current.componentTree ? { componentTree: args.componentTree ?? current.componentTree } : {},
7400
+ ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
7401
+ ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {},
7402
+ ...current.dataAssemblies ? { dataAssemblies: current.dataAssemblies } : {}
7403
+ };
7349
7404
  const experienceTemplate = await contentfulClient.experienceTemplate.upsert(
7350
7405
  params,
7351
- {
7352
- sys: {
7353
- id: current.sys.id,
7354
- type: "ExperienceTemplate",
7355
- version: current.sys.version
7356
- },
7357
- name: args.name ?? current.name,
7358
- description: args.description ?? current.description,
7359
- viewports: args.viewports ?? current.viewports,
7360
- contentProperties: args.contentProperties ?? current.contentProperties,
7361
- designProperties: args.designProperties ?? current.designProperties,
7362
- ...args.componentTree ?? current.componentTree ? { componentTree: args.componentTree ?? current.componentTree } : {},
7363
- ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
7364
- ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {},
7365
- ...current.dataAssemblies ? { dataAssemblies: current.dataAssemblies } : {}
7366
- }
7406
+ asViewportOptionalCmaPayload(experienceTemplateData)
7367
7407
  );
7368
7408
  return createSuccessResponse("Experience template updated successfully", {
7369
7409
  experienceTemplate
@@ -7655,9 +7695,17 @@ var CreateExperienceToolParams = BaseToolSchema.extend({
7655
7695
  experienceTemplate: ExperienceTemplateResourceLinkSchema.describe(
7656
7696
  "Resource link to the ExperienceTemplate this experience is backed by"
7657
7697
  ),
7658
- viewports: z109.array(ViewportSchema).describe("Viewport definitions for the experience (may be empty)"),
7659
- designProperties: z109.record(z109.string(), DimensionedDesignPropertyValueSchema).describe(
7660
- "Design property values keyed by property ID. Each value is a dimensioned map (viewport ID \u2192 design value). May be an empty object."
7698
+ viewports: z109.array(ViewportSchema).optional().describe(
7699
+ "Optional viewport definitions for the experience. Omit for viewport-free experiences."
7700
+ ),
7701
+ designProperties: z109.record(
7702
+ z109.string(),
7703
+ z109.union([
7704
+ DesignPropertyValueSchema,
7705
+ DimensionedDesignPropertyValueSchema
7706
+ ])
7707
+ ).describe(
7708
+ "Design property values keyed by property ID. When viewports are provided, each value is a dimensioned map (viewport ID \u2192 design value); without viewports, use a direct design value. May be an empty object."
7661
7709
  ),
7662
7710
  contentBindings: ExperienceContentBindingsSchema.optional().describe(
7663
7711
  "Optional content bindings linking this experience to a data assembly"
@@ -7676,18 +7724,19 @@ function createExperienceTool(config) {
7676
7724
  config.protectedEnvironments
7677
7725
  );
7678
7726
  const contentfulClient = createExoToolClient(config, args);
7727
+ const experienceData = {
7728
+ name: args.name,
7729
+ description: args.description,
7730
+ experienceTemplate: args.experienceTemplate,
7731
+ ...args.viewports !== void 0 && { viewports: args.viewports },
7732
+ designProperties: args.designProperties,
7733
+ ...args.contentBindings && { contentBindings: args.contentBindings },
7734
+ ...args.slots && { slots: args.slots },
7735
+ ...args.metadata && { metadata: args.metadata }
7736
+ };
7679
7737
  const experience = await contentfulClient.experience.create(
7680
7738
  { spaceId: args.spaceId, environmentId: args.environmentId },
7681
- {
7682
- name: args.name,
7683
- description: args.description,
7684
- experienceTemplate: args.experienceTemplate,
7685
- viewports: args.viewports,
7686
- designProperties: args.designProperties,
7687
- ...args.contentBindings && { contentBindings: args.contentBindings },
7688
- ...args.slots && { slots: args.slots },
7689
- ...args.metadata && { metadata: args.metadata }
7690
- }
7739
+ asViewportOptionalCmaPayloadWithFlattenedDesignProperties(experienceData)
7691
7740
  );
7692
7741
  return createSuccessResponse("Experience created successfully", {
7693
7742
  experience
@@ -7706,7 +7755,13 @@ var UpsertExperienceToolParams = BaseToolSchema.extend({
7706
7755
  name: z110.string().optional().describe("The name of the experience"),
7707
7756
  description: z110.string().optional().describe("Description of the experience"),
7708
7757
  viewports: z110.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
7709
- designProperties: z110.record(z110.string(), DimensionedDesignPropertyValueSchema).optional().describe(
7758
+ designProperties: z110.record(
7759
+ z110.string(),
7760
+ z110.union([
7761
+ DesignPropertyValueSchema,
7762
+ DimensionedDesignPropertyValueSchema
7763
+ ])
7764
+ ).optional().describe(
7710
7765
  "Design property values keyed by property ID; replaces existing if provided"
7711
7766
  ),
7712
7767
  contentBindings: ExperienceContentBindingsSchema.optional().describe(
@@ -7735,7 +7790,8 @@ function upsertExperienceTool(config) {
7735
7790
  `Version conflict: the experience has changed since you read it (your version: ${args.version}, current version: ${current.sys.version}). Re-fetch the experience with get_experience and retry the update with the latest sys.version.`
7736
7791
  );
7737
7792
  }
7738
- const experience = await contentfulClient.experience.upsert(params, {
7793
+ const viewports = args.viewports ?? current.viewports;
7794
+ const experienceData = {
7739
7795
  sys: {
7740
7796
  id: current.sys.id,
7741
7797
  type: "Experience",
@@ -7743,12 +7799,16 @@ function upsertExperienceTool(config) {
7743
7799
  },
7744
7800
  name: args.name ?? current.name,
7745
7801
  description: args.description ?? current.description,
7746
- viewports: args.viewports ?? current.viewports,
7802
+ ...viewports !== void 0 && { viewports },
7747
7803
  designProperties: args.designProperties ?? current.designProperties,
7748
7804
  ...args.contentBindings ?? current.contentBindings ? { contentBindings: args.contentBindings ?? current.contentBindings } : {},
7749
7805
  ...args.slots ?? current.slots ? { slots: args.slots ?? current.slots } : {},
7750
7806
  ...args.metadata ?? current.metadata ? { metadata: args.metadata ?? current.metadata } : {}
7751
- });
7807
+ };
7808
+ const experience = await contentfulClient.experience.upsert(
7809
+ params,
7810
+ asViewportOptionalCmaPayloadWithFlattenedDesignProperties(experienceData)
7811
+ );
7752
7812
  return createSuccessResponse("Experience updated successfully", {
7753
7813
  experience
7754
7814
  });
@@ -9133,6 +9193,276 @@ function listReleaseActionsTool(config) {
9133
9193
  return withErrorHandling(tool2, "Error listing release actions");
9134
9194
  }
9135
9195
 
9196
+ // src/tools/releases/scheduleReleasePublish.ts
9197
+ import { z as z139 } from "zod";
9198
+ var SchedulePublishReleaseToolParams = BaseToolSchema.extend({
9199
+ releaseId: z139.string().describe("The ID of the release to schedule for publish"),
9200
+ datetime: z139.string().datetime({ offset: true }).describe("The ISO 8601 datetime at which the release should publish"),
9201
+ timezone: z139.string().refine((timezone) => {
9202
+ try {
9203
+ Intl.DateTimeFormat("en-US", { timeZone: timezone }).format(0);
9204
+ return true;
9205
+ } catch {
9206
+ return false;
9207
+ }
9208
+ }, "Must be a valid IANA timezone identifier").optional().describe("A valid IANA timezone identifier (e.g. Asia/Kolkata)"),
9209
+ scheduledActionId: z139.string().optional().describe(
9210
+ "Provide to reschedule an existing scheduled action instead of creating a new one"
9211
+ )
9212
+ });
9213
+ function schedulePublishReleaseTool(config) {
9214
+ async function tool2(args) {
9215
+ assertEnvironmentNotProtected(
9216
+ args.environmentId,
9217
+ config.protectedEnvironments
9218
+ );
9219
+ const contentfulClient = createToolClient(config, args);
9220
+ if (args.scheduledActionId) {
9221
+ const existing = await contentfulClient.scheduledActions.get({
9222
+ spaceId: args.spaceId,
9223
+ environmentId: args.environmentId,
9224
+ scheduledActionId: args.scheduledActionId
9225
+ });
9226
+ if (existing.action !== "publish") {
9227
+ throw new Error(
9228
+ `Scheduled action '${args.scheduledActionId}' is a '${existing.action}' action, not 'publish'.`
9229
+ );
9230
+ }
9231
+ if (existing.entity.sys.id !== args.releaseId) {
9232
+ throw new Error(
9233
+ `Scheduled action '${args.scheduledActionId}' targets release '${existing.entity.sys.id}', not '${args.releaseId}'.`
9234
+ );
9235
+ }
9236
+ const scheduledAction2 = await contentfulClient.scheduledActions.update(
9237
+ {
9238
+ spaceId: args.spaceId,
9239
+ scheduledActionId: args.scheduledActionId,
9240
+ version: existing.sys.version
9241
+ },
9242
+ {
9243
+ action: "publish",
9244
+ entity: existing.entity,
9245
+ environment: existing.environment,
9246
+ scheduledFor: {
9247
+ datetime: args.datetime,
9248
+ timezone: args.timezone
9249
+ }
9250
+ }
9251
+ );
9252
+ return createSuccessResponse(
9253
+ "Scheduled release publish rescheduled successfully",
9254
+ { scheduledAction: scheduledAction2 }
9255
+ );
9256
+ }
9257
+ const scheduledAction = await contentfulClient.scheduledActions.create(
9258
+ { spaceId: args.spaceId },
9259
+ {
9260
+ entity: {
9261
+ sys: { type: "Link", linkType: "Release", id: args.releaseId }
9262
+ },
9263
+ environment: {
9264
+ sys: {
9265
+ type: "Link",
9266
+ linkType: "Environment",
9267
+ id: args.environmentId
9268
+ }
9269
+ },
9270
+ action: "publish",
9271
+ scheduledFor: {
9272
+ datetime: args.datetime,
9273
+ timezone: args.timezone
9274
+ }
9275
+ }
9276
+ );
9277
+ return createSuccessResponse("Release publish scheduled successfully", {
9278
+ scheduledAction
9279
+ });
9280
+ }
9281
+ return withErrorHandling(tool2, "Error scheduling release publish");
9282
+ }
9283
+
9284
+ // src/tools/releases/scheduleReleaseUnpublish.ts
9285
+ import { z as z140 } from "zod";
9286
+ var ScheduleUnpublishReleaseToolParams = BaseToolSchema.extend({
9287
+ releaseId: z140.string().describe("The ID of the release to schedule for unpublish"),
9288
+ datetime: z140.string().datetime({ offset: true }).describe("The ISO 8601 datetime at which the release should unpublish"),
9289
+ timezone: z140.string().refine((timezone) => {
9290
+ try {
9291
+ Intl.DateTimeFormat("en-US", { timeZone: timezone }).format(0);
9292
+ return true;
9293
+ } catch {
9294
+ return false;
9295
+ }
9296
+ }, "Must be a valid IANA timezone identifier").optional().describe("A valid IANA timezone identifier (e.g. Asia/Kolkata)"),
9297
+ scheduledActionId: z140.string().optional().describe(
9298
+ "Provide to reschedule an existing scheduled action instead of creating a new one"
9299
+ )
9300
+ });
9301
+ function scheduleUnpublishReleaseTool(config) {
9302
+ async function tool2(args) {
9303
+ assertEnvironmentNotProtected(
9304
+ args.environmentId,
9305
+ config.protectedEnvironments
9306
+ );
9307
+ const contentfulClient = createToolClient(config, args);
9308
+ if (args.scheduledActionId) {
9309
+ const existing = await contentfulClient.scheduledActions.get({
9310
+ spaceId: args.spaceId,
9311
+ environmentId: args.environmentId,
9312
+ scheduledActionId: args.scheduledActionId
9313
+ });
9314
+ if (existing.action !== "unpublish") {
9315
+ throw new Error(
9316
+ `Scheduled action '${args.scheduledActionId}' is a '${existing.action}' action, not 'unpublish'.`
9317
+ );
9318
+ }
9319
+ if (existing.entity.sys.id !== args.releaseId) {
9320
+ throw new Error(
9321
+ `Scheduled action '${args.scheduledActionId}' targets release '${existing.entity.sys.id}', not '${args.releaseId}'.`
9322
+ );
9323
+ }
9324
+ const scheduledAction2 = await contentfulClient.scheduledActions.update(
9325
+ {
9326
+ spaceId: args.spaceId,
9327
+ scheduledActionId: args.scheduledActionId,
9328
+ version: existing.sys.version
9329
+ },
9330
+ {
9331
+ action: "unpublish",
9332
+ entity: existing.entity,
9333
+ environment: existing.environment,
9334
+ scheduledFor: {
9335
+ datetime: args.datetime,
9336
+ timezone: args.timezone
9337
+ }
9338
+ }
9339
+ );
9340
+ return createSuccessResponse(
9341
+ "Scheduled release unpublish rescheduled successfully",
9342
+ { scheduledAction: scheduledAction2 }
9343
+ );
9344
+ }
9345
+ const scheduledAction = await contentfulClient.scheduledActions.create(
9346
+ { spaceId: args.spaceId },
9347
+ {
9348
+ entity: {
9349
+ sys: { type: "Link", linkType: "Release", id: args.releaseId }
9350
+ },
9351
+ environment: {
9352
+ sys: {
9353
+ type: "Link",
9354
+ linkType: "Environment",
9355
+ id: args.environmentId
9356
+ }
9357
+ },
9358
+ action: "unpublish",
9359
+ scheduledFor: {
9360
+ datetime: args.datetime,
9361
+ timezone: args.timezone
9362
+ }
9363
+ }
9364
+ );
9365
+ return createSuccessResponse("Release unpublish scheduled successfully", {
9366
+ scheduledAction
9367
+ });
9368
+ }
9369
+ return withErrorHandling(tool2, "Error scheduling release unpublish");
9370
+ }
9371
+
9372
+ // src/tools/releases/cancelScheduledRelease.ts
9373
+ import { z as z141 } from "zod";
9374
+ var CancelScheduledReleaseToolParams = BaseToolSchema.extend({
9375
+ releaseId: z141.string().describe("The ID of the release the scheduled action belongs to"),
9376
+ scheduledActionId: z141.string().describe("The ID of the scheduled action to cancel"),
9377
+ confirm: z141.boolean().optional().describe(
9378
+ "Set to true on the second call to actually cancel the scheduled action. Required together with confirmToken."
9379
+ ),
9380
+ confirmToken: z141.string().optional().describe(
9381
+ "Token returned by the preview call; must be supplied with confirm: true."
9382
+ )
9383
+ });
9384
+ function cancelScheduledReleaseTool(config) {
9385
+ async function tool2(args) {
9386
+ assertEnvironmentNotProtected(
9387
+ args.environmentId,
9388
+ config.protectedEnvironments
9389
+ );
9390
+ const contentfulClient = createToolClient(config, args);
9391
+ const scheduledAction = await contentfulClient.scheduledActions.get({
9392
+ spaceId: args.spaceId,
9393
+ environmentId: args.environmentId,
9394
+ scheduledActionId: args.scheduledActionId
9395
+ });
9396
+ if (scheduledAction.entity.sys.id !== args.releaseId) {
9397
+ throw new Error(
9398
+ `Scheduled action '${args.scheduledActionId}' targets release '${scheduledAction.entity.sys.id}', not '${args.releaseId}'.`
9399
+ );
9400
+ }
9401
+ const expectedToken = buildConfirmToken(
9402
+ "scheduledAction",
9403
+ args.scheduledActionId,
9404
+ scheduledAction.sys.version
9405
+ );
9406
+ if (args.confirm !== true || args.confirmToken !== expectedToken) {
9407
+ const preview = buildConfirmationPreview(
9408
+ "scheduledAction",
9409
+ args.scheduledActionId,
9410
+ { scheduledAction },
9411
+ expectedToken
9412
+ );
9413
+ return createSuccessResponse(
9414
+ `${CONFIRMATION_MESSAGE_PREFIX} scheduled action`,
9415
+ preview
9416
+ );
9417
+ }
9418
+ await contentfulClient.scheduledActions.delete({
9419
+ spaceId: args.spaceId,
9420
+ environmentId: args.environmentId,
9421
+ scheduledActionId: args.scheduledActionId
9422
+ });
9423
+ return createSuccessResponse(
9424
+ "Scheduled release action canceled successfully",
9425
+ { scheduledAction }
9426
+ );
9427
+ }
9428
+ return withErrorHandling(tool2, "Error canceling scheduled release action");
9429
+ }
9430
+
9431
+ // src/tools/releases/listScheduledActions.ts
9432
+ import { z as z142 } from "zod";
9433
+ var MAX_ITEMS3 = 10;
9434
+ var ListScheduledActionsToolParams = BaseToolSchema.extend({
9435
+ releaseId: z142.string().optional().describe("Filter by the release this scheduled action targets"),
9436
+ statusIn: z142.string().optional().describe(
9437
+ "Comma-separated list of statuses to include (scheduled, inProgress, succeeded, failed, canceled)"
9438
+ ),
9439
+ statusNin: z142.string().optional().describe("Comma-separated list of statuses to exclude"),
9440
+ limit: z142.number().optional().describe("Maximum number of scheduled actions to return (max 10)")
9441
+ });
9442
+ function listScheduledActionsTool(config) {
9443
+ async function tool2(args) {
9444
+ const contentfulClient = createToolClient(config, args);
9445
+ const scheduledActions = await contentfulClient.scheduledActions.getMany({
9446
+ spaceId: args.spaceId,
9447
+ query: {
9448
+ "environment.sys.id": args.environmentId,
9449
+ limit: Math.max(1, Math.min(args.limit ?? MAX_ITEMS3, MAX_ITEMS3)),
9450
+ ...args.releaseId && { "entity.sys.id": args.releaseId },
9451
+ ...args.statusIn && { "sys.status[in]": args.statusIn },
9452
+ ...args.statusNin && { "sys.status[nin]": args.statusNin }
9453
+ }
9454
+ });
9455
+ const summarized = summarizeData(scheduledActions, {
9456
+ maxItems: MAX_ITEMS3,
9457
+ remainingMessage: "To see more scheduled actions, narrow your filters or ask for a smaller limit."
9458
+ });
9459
+ return createSuccessResponse("Scheduled actions retrieved successfully", {
9460
+ scheduledActions: summarized
9461
+ });
9462
+ }
9463
+ return withErrorHandling(tool2, "Error listing scheduled actions");
9464
+ }
9465
+
9136
9466
  // src/tools/releases/register.ts
9137
9467
  function createReleaseTools(config) {
9138
9468
  const listReleases = listReleasesTool(config);
@@ -9145,6 +9475,10 @@ function createReleaseTools(config) {
9145
9475
  const validateRelease = validateReleaseTool(config);
9146
9476
  const getReleaseAction = getReleaseActionTool(config);
9147
9477
  const listReleaseActions = listReleaseActionsTool(config);
9478
+ const schedulePublishRelease = schedulePublishReleaseTool(config);
9479
+ const scheduleUnpublishRelease = scheduleUnpublishReleaseTool(config);
9480
+ const cancelScheduledRelease = cancelScheduledReleaseTool(config);
9481
+ const listScheduledActions = listScheduledActionsTool(config);
9148
9482
  return {
9149
9483
  listReleases: {
9150
9484
  title: "list_releases",
@@ -9261,6 +9595,53 @@ function createReleaseTools(config) {
9261
9595
  openWorldHint: false
9262
9596
  },
9263
9597
  tool: listReleaseActions
9598
+ },
9599
+ schedulePublishRelease: {
9600
+ title: "schedule_publish_release",
9601
+ description: "Schedule a release to publish at a future datetime, or reschedule an existing scheduled publish action by providing scheduledActionId.",
9602
+ inputParams: SchedulePublishReleaseToolParams.shape,
9603
+ annotations: {
9604
+ readOnlyHint: false,
9605
+ destructiveHint: true,
9606
+ idempotentHint: false,
9607
+ openWorldHint: false
9608
+ },
9609
+ tool: schedulePublishRelease
9610
+ },
9611
+ scheduleUnpublishRelease: {
9612
+ title: "schedule_unpublish_release",
9613
+ description: "Schedule a release to unpublish at a future datetime, or reschedule an existing scheduled unpublish action by providing scheduledActionId.",
9614
+ inputParams: ScheduleUnpublishReleaseToolParams.shape,
9615
+ annotations: {
9616
+ readOnlyHint: false,
9617
+ destructiveHint: true,
9618
+ idempotentHint: false,
9619
+ openWorldHint: false
9620
+ },
9621
+ tool: scheduleUnpublishRelease
9622
+ },
9623
+ cancelScheduledRelease: {
9624
+ title: "cancel_scheduled_release",
9625
+ description: "Cancel a scheduled release action. This is a two-phase operation: the first call (without confirm/confirmToken) returns a preview of the scheduled action and a confirmToken. To complete the cancellation, call this tool again with the same scheduledActionId, confirm: true, and the confirmToken from the preview response.",
9626
+ inputParams: CancelScheduledReleaseToolParams.shape,
9627
+ annotations: {
9628
+ readOnlyHint: false,
9629
+ destructiveHint: true,
9630
+ idempotentHint: false,
9631
+ openWorldHint: false
9632
+ },
9633
+ tool: cancelScheduledRelease
9634
+ },
9635
+ listScheduledActions: {
9636
+ title: "list_scheduled_actions",
9637
+ description: "List scheduled actions in a space/environment. Returns a maximum of 10 items per request. Optionally filter by release ID or status.",
9638
+ inputParams: ListScheduledActionsToolParams.shape,
9639
+ annotations: {
9640
+ readOnlyHint: true,
9641
+ destructiveHint: false,
9642
+ openWorldHint: false
9643
+ },
9644
+ tool: listScheduledActions
9264
9645
  }
9265
9646
  };
9266
9647
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/mcp-tools",
3
- "version": "0.12.13",
3
+ "version": "0.12.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",