@contentful/mcp-tools 0.12.11 → 0.12.13
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 +75 -64
- package/dist/index.d.ts +273 -2
- package/dist/index.js +508 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
jobTools, // Long-running jobs
|
|
66
66
|
localeTools, // Locale management
|
|
67
67
|
orgTools, // Organization operations
|
|
68
|
+
releaseTools, // Release management
|
|
68
69
|
spaceTools, // Space operations
|
|
69
70
|
tagTools, // Tag management
|
|
70
71
|
taxonomyTools, // Taxonomy/concept scheme operations
|
|
@@ -82,70 +83,80 @@ Each tool includes semantic annotations to help MCP clients understand tool beha
|
|
|
82
83
|
|
|
83
84
|
## 🛠️ Available Tools
|
|
84
85
|
|
|
85
|
-
| Category | Tool Name | Description
|
|
86
|
-
| ------------------------- | ---------------------------------- |
|
|
87
|
-
| **Context & Setup** | `get_initial_context` | Initialize connection and get usage instructions
|
|
88
|
-
| **Content Types** | `list_content_types` | List content types (max 10 per request)
|
|
89
|
-
| | `get_content_type` | Get detailed content type information
|
|
90
|
-
| | `create_content_type` | Create new content types
|
|
91
|
-
| | `update_content_type` | Modify existing content types
|
|
92
|
-
| | `publish_content_type` | Publish content type changes
|
|
93
|
-
| | `unpublish_content_type` | Unpublish content types
|
|
94
|
-
| | `delete_content_type` | Remove content types
|
|
95
|
-
| **Entries** | `search_entries` | Search and filter entries in your space
|
|
96
|
-
| | `get_entry` | Retrieve specific entries
|
|
97
|
-
| | `create_entry` | Create new content entries with locale support
|
|
98
|
-
| | `update_entry` | Modify existing entries with locale support
|
|
99
|
-
| | `publish_entry` | Publish entries (single or bulk up to 100)
|
|
100
|
-
| | `unpublish_entry` | Unpublish entries (single or bulk up to 100)
|
|
101
|
-
| | `delete_entry` | Remove entries
|
|
102
|
-
| **Editor Interfaces** | `list_editor_interfaces` | List all editor interfaces in a space
|
|
103
|
-
| | `get_editor_interface` | Get editor interface for a content type
|
|
104
|
-
| | `update_editor_interface` | Update field controls, sidebars, and layouts
|
|
105
|
-
| **Assets** | `upload_asset` | Upload new assets
|
|
106
|
-
| | `list_assets` | List and browse assets (max 3 per request)
|
|
107
|
-
| | `get_asset` | Retrieve specific assets
|
|
108
|
-
| | `update_asset` | Modify asset metadata
|
|
109
|
-
| | `publish_asset` | Publish assets (single or bulk up to 100)
|
|
110
|
-
| | `unpublish_asset` | Unpublish assets (single or bulk up to 100)
|
|
111
|
-
| | `delete_asset` | Remove assets
|
|
112
|
-
| **Spaces & Environments** | `list_spaces` | List available spaces (max 10 per request)
|
|
113
|
-
| | `get_space` | Get space details
|
|
114
|
-
| | `list_environments` | List environments in a space
|
|
115
|
-
| | `create_environment` | Create new environments
|
|
116
|
-
| | `delete_environment` | Remove environments
|
|
117
|
-
| **Locales** | `list_locales` | List all locales in your environment
|
|
118
|
-
| | `get_locale` | Retrieve specific locale information
|
|
119
|
-
| | `create_locale` | Create new locales for multi-language content
|
|
120
|
-
| | `update_locale` | Modify existing locale settings
|
|
121
|
-
| | `delete_locale` | Remove locales from environment
|
|
122
|
-
| **Tags** | `list_tags` | List all tags in an environment
|
|
123
|
-
| | `create_tag` | Create new tags with public/private visibility
|
|
124
|
-
| **Organizations** | `list_orgs` | List organizations user has access to
|
|
125
|
-
| | `get_org` | Get details of a specific organization
|
|
126
|
-
| **
|
|
127
|
-
| | `
|
|
128
|
-
| | `
|
|
129
|
-
| | `
|
|
130
|
-
| | `
|
|
131
|
-
| | `
|
|
132
|
-
| | `
|
|
133
|
-
| | `
|
|
134
|
-
| | `
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
| | `
|
|
138
|
-
| | `
|
|
139
|
-
| | `
|
|
140
|
-
|
|
|
141
|
-
| | `
|
|
142
|
-
| | `
|
|
143
|
-
| | `
|
|
144
|
-
| | `
|
|
145
|
-
| **
|
|
146
|
-
| | `
|
|
147
|
-
| | `
|
|
148
|
-
| | `
|
|
86
|
+
| Category | Tool Name | Description |
|
|
87
|
+
| ------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
88
|
+
| **Context & Setup** | `get_initial_context` | Initialize connection and get usage instructions |
|
|
89
|
+
| **Content Types** | `list_content_types` | List content types (max 10 per request) |
|
|
90
|
+
| | `get_content_type` | Get detailed content type information |
|
|
91
|
+
| | `create_content_type` | Create new content types |
|
|
92
|
+
| | `update_content_type` | Modify existing content types |
|
|
93
|
+
| | `publish_content_type` | Publish content type changes |
|
|
94
|
+
| | `unpublish_content_type` | Unpublish content types |
|
|
95
|
+
| | `delete_content_type` | Remove content types |
|
|
96
|
+
| **Entries** | `search_entries` | Search and filter entries in your space |
|
|
97
|
+
| | `get_entry` | Retrieve specific entries |
|
|
98
|
+
| | `create_entry` | Create new content entries with locale support |
|
|
99
|
+
| | `update_entry` | Modify existing entries with locale support |
|
|
100
|
+
| | `publish_entry` | Publish entries (single or bulk up to 100) |
|
|
101
|
+
| | `unpublish_entry` | Unpublish entries (single or bulk up to 100) |
|
|
102
|
+
| | `delete_entry` | Remove entries |
|
|
103
|
+
| **Editor Interfaces** | `list_editor_interfaces` | List all editor interfaces in a space |
|
|
104
|
+
| | `get_editor_interface` | Get editor interface for a content type |
|
|
105
|
+
| | `update_editor_interface` | Update field controls, sidebars, and layouts |
|
|
106
|
+
| **Assets** | `upload_asset` | Upload new assets |
|
|
107
|
+
| | `list_assets` | List and browse assets (max 3 per request) |
|
|
108
|
+
| | `get_asset` | Retrieve specific assets |
|
|
109
|
+
| | `update_asset` | Modify asset metadata |
|
|
110
|
+
| | `publish_asset` | Publish assets (single or bulk up to 100) |
|
|
111
|
+
| | `unpublish_asset` | Unpublish assets (single or bulk up to 100) |
|
|
112
|
+
| | `delete_asset` | Remove assets |
|
|
113
|
+
| **Spaces & Environments** | `list_spaces` | List available spaces (max 10 per request) |
|
|
114
|
+
| | `get_space` | Get space details |
|
|
115
|
+
| | `list_environments` | List environments in a space |
|
|
116
|
+
| | `create_environment` | Create new environments |
|
|
117
|
+
| | `delete_environment` | Remove environments |
|
|
118
|
+
| **Locales** | `list_locales` | List all locales in your environment |
|
|
119
|
+
| | `get_locale` | Retrieve specific locale information |
|
|
120
|
+
| | `create_locale` | Create new locales for multi-language content |
|
|
121
|
+
| | `update_locale` | Modify existing locale settings |
|
|
122
|
+
| | `delete_locale` | Remove locales from environment |
|
|
123
|
+
| **Tags** | `list_tags` | List all tags in an environment |
|
|
124
|
+
| | `create_tag` | Create new tags with public/private visibility |
|
|
125
|
+
| **Organizations** | `list_orgs` | List organizations user has access to |
|
|
126
|
+
| | `get_org` | Get details of a specific organization |
|
|
127
|
+
| **Releases** | `list_releases` | List releases (max 10 per request) |
|
|
128
|
+
| | `get_release` | Retrieve a release |
|
|
129
|
+
| | `create_release` | Create a release with Entries/Assets |
|
|
130
|
+
| | `update_release` | Modify a release's title and/or contents |
|
|
131
|
+
| | `delete_release` | Remove a release (and its linked release actions) |
|
|
132
|
+
| | `publish_release` | Publish a release (async; check via `get_release_action`) |
|
|
133
|
+
| | `unpublish_release` | Unpublish a release (async; check via `get_release_action`) |
|
|
134
|
+
| | `validate_release` | Validate a release, optionally against publish/unpublish |
|
|
135
|
+
| | `get_release_action` | Check the status of a queued release action |
|
|
136
|
+
| | `list_release_actions` | List release actions (max 10 per request) |
|
|
137
|
+
| **AI Actions** | `create_ai_action` | Create custom AI-powered workflows |
|
|
138
|
+
| | `invoke_ai_action` | Invoke AI action with variables (bulk support) |
|
|
139
|
+
| | `get_ai_action_invocation` | Get AI action invocation details |
|
|
140
|
+
| | `get_ai_action` | Retrieve AI action details and configuration |
|
|
141
|
+
| | `list_ai_actions` | List AI actions in a space (max 3 per request) |
|
|
142
|
+
| | `update_ai_action` | Update existing AI actions |
|
|
143
|
+
| | `publish_ai_action` | Publish AI actions for use |
|
|
144
|
+
| | `unpublish_ai_action` | Unpublish AI actions |
|
|
145
|
+
| | `delete_ai_action` | Remove AI actions |
|
|
146
|
+
| **Taxonomy Concepts** | `create_concept` | Create new taxonomy concepts with localization |
|
|
147
|
+
| | `get_concept` | Retrieve specific taxonomy concept |
|
|
148
|
+
| | `list_concepts` | List concepts with filtering and hierarchy |
|
|
149
|
+
| | `update_concept` | Update taxonomy concept properties |
|
|
150
|
+
| | `delete_concept` | Remove taxonomy concepts |
|
|
151
|
+
| **Taxonomy Schemes** | `create_concept_scheme` | Create new taxonomy concept schemes |
|
|
152
|
+
| | `get_concept_scheme` | Retrieve specific concept scheme |
|
|
153
|
+
| | `list_concept_schemes` | List concept schemes with pagination |
|
|
154
|
+
| | `update_concept_scheme` | Update concept scheme properties |
|
|
155
|
+
| | `delete_concept_scheme` | Remove concept schemes |
|
|
156
|
+
| **Space Migration** | `space_to_space_migration_handler` | Enable/disable space migration workflow |
|
|
157
|
+
| | `space_to_space_param_collection` | Collect parameters for migration workflow |
|
|
158
|
+
| | `export_space` | Export space to file for migration |
|
|
159
|
+
| | `import_space` | Import space from exported file |
|
|
149
160
|
| **Usage** | `get_usages` | Get aggregated usage metrics for an organization, optionally filtered or grouped by space |
|
|
150
161
|
|
|
151
162
|
## Configuration
|
package/dist/index.d.ts
CHANGED
|
@@ -8321,6 +8321,277 @@ declare class ContentfulMcpTools {
|
|
|
8321
8321
|
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8322
8322
|
};
|
|
8323
8323
|
};
|
|
8324
|
+
/**
|
|
8325
|
+
* Get release tools
|
|
8326
|
+
*/
|
|
8327
|
+
getReleaseTools(): {
|
|
8328
|
+
listReleases: {
|
|
8329
|
+
title: string;
|
|
8330
|
+
description: string;
|
|
8331
|
+
inputParams: {
|
|
8332
|
+
spaceId: zod.ZodString;
|
|
8333
|
+
environmentId: zod.ZodString;
|
|
8334
|
+
} & {
|
|
8335
|
+
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
8336
|
+
pageNext: zod.ZodOptional<zod.ZodString>;
|
|
8337
|
+
pagePrev: zod.ZodOptional<zod.ZodString>;
|
|
8338
|
+
statusIn: zod.ZodOptional<zod.ZodString>;
|
|
8339
|
+
statusNin: zod.ZodOptional<zod.ZodString>;
|
|
8340
|
+
titleMatch: zod.ZodOptional<zod.ZodString>;
|
|
8341
|
+
entitiesLinkType: zod.ZodOptional<zod.ZodEnum<["Entry", "Asset"]>>;
|
|
8342
|
+
entitiesSysIdIn: zod.ZodOptional<zod.ZodString>;
|
|
8343
|
+
};
|
|
8344
|
+
annotations: {
|
|
8345
|
+
readOnlyHint: boolean;
|
|
8346
|
+
destructiveHint: boolean;
|
|
8347
|
+
openWorldHint: boolean;
|
|
8348
|
+
};
|
|
8349
|
+
tool: (params: {
|
|
8350
|
+
spaceId: string;
|
|
8351
|
+
environmentId: string;
|
|
8352
|
+
limit?: number | undefined;
|
|
8353
|
+
pageNext?: string | undefined;
|
|
8354
|
+
pagePrev?: string | undefined;
|
|
8355
|
+
statusIn?: string | undefined;
|
|
8356
|
+
statusNin?: string | undefined;
|
|
8357
|
+
titleMatch?: string | undefined;
|
|
8358
|
+
entitiesLinkType?: "Entry" | "Asset" | undefined;
|
|
8359
|
+
entitiesSysIdIn?: string | undefined;
|
|
8360
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8361
|
+
};
|
|
8362
|
+
getRelease: {
|
|
8363
|
+
title: string;
|
|
8364
|
+
description: string;
|
|
8365
|
+
inputParams: {
|
|
8366
|
+
spaceId: zod.ZodString;
|
|
8367
|
+
environmentId: zod.ZodString;
|
|
8368
|
+
} & {
|
|
8369
|
+
releaseId: zod.ZodString;
|
|
8370
|
+
};
|
|
8371
|
+
annotations: {
|
|
8372
|
+
readOnlyHint: boolean;
|
|
8373
|
+
destructiveHint: boolean;
|
|
8374
|
+
openWorldHint: boolean;
|
|
8375
|
+
};
|
|
8376
|
+
tool: (params: {
|
|
8377
|
+
spaceId: string;
|
|
8378
|
+
environmentId: string;
|
|
8379
|
+
releaseId: string;
|
|
8380
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8381
|
+
};
|
|
8382
|
+
createRelease: {
|
|
8383
|
+
title: string;
|
|
8384
|
+
description: string;
|
|
8385
|
+
inputParams: {
|
|
8386
|
+
spaceId: zod.ZodString;
|
|
8387
|
+
environmentId: zod.ZodString;
|
|
8388
|
+
} & {
|
|
8389
|
+
title: zod.ZodString;
|
|
8390
|
+
entities: zod.ZodArray<zod.ZodObject<{
|
|
8391
|
+
id: zod.ZodString;
|
|
8392
|
+
linkType: zod.ZodEnum<["Entry", "Asset"]>;
|
|
8393
|
+
}, "strip", zod.ZodTypeAny, {
|
|
8394
|
+
id: string;
|
|
8395
|
+
linkType: "Entry" | "Asset";
|
|
8396
|
+
}, {
|
|
8397
|
+
id: string;
|
|
8398
|
+
linkType: "Entry" | "Asset";
|
|
8399
|
+
}>, "many">;
|
|
8400
|
+
};
|
|
8401
|
+
annotations: {
|
|
8402
|
+
readOnlyHint: boolean;
|
|
8403
|
+
destructiveHint: boolean;
|
|
8404
|
+
idempotentHint: boolean;
|
|
8405
|
+
openWorldHint: boolean;
|
|
8406
|
+
};
|
|
8407
|
+
tool: (params: {
|
|
8408
|
+
title: string;
|
|
8409
|
+
spaceId: string;
|
|
8410
|
+
environmentId: string;
|
|
8411
|
+
entities: {
|
|
8412
|
+
id: string;
|
|
8413
|
+
linkType: "Entry" | "Asset";
|
|
8414
|
+
}[];
|
|
8415
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8416
|
+
};
|
|
8417
|
+
updateRelease: {
|
|
8418
|
+
title: string;
|
|
8419
|
+
description: string;
|
|
8420
|
+
inputParams: {
|
|
8421
|
+
spaceId: zod.ZodString;
|
|
8422
|
+
environmentId: zod.ZodString;
|
|
8423
|
+
} & {
|
|
8424
|
+
releaseId: zod.ZodString;
|
|
8425
|
+
title: zod.ZodOptional<zod.ZodString>;
|
|
8426
|
+
entities: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
8427
|
+
id: zod.ZodString;
|
|
8428
|
+
linkType: zod.ZodEnum<["Entry", "Asset"]>;
|
|
8429
|
+
}, "strip", zod.ZodTypeAny, {
|
|
8430
|
+
id: string;
|
|
8431
|
+
linkType: "Entry" | "Asset";
|
|
8432
|
+
}, {
|
|
8433
|
+
id: string;
|
|
8434
|
+
linkType: "Entry" | "Asset";
|
|
8435
|
+
}>, "many">>;
|
|
8436
|
+
};
|
|
8437
|
+
annotations: {
|
|
8438
|
+
readOnlyHint: boolean;
|
|
8439
|
+
destructiveHint: boolean;
|
|
8440
|
+
idempotentHint: boolean;
|
|
8441
|
+
openWorldHint: boolean;
|
|
8442
|
+
};
|
|
8443
|
+
tool: (params: {
|
|
8444
|
+
spaceId: string;
|
|
8445
|
+
environmentId: string;
|
|
8446
|
+
releaseId: string;
|
|
8447
|
+
title?: string | undefined;
|
|
8448
|
+
entities?: {
|
|
8449
|
+
id: string;
|
|
8450
|
+
linkType: "Entry" | "Asset";
|
|
8451
|
+
}[] | undefined;
|
|
8452
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8453
|
+
};
|
|
8454
|
+
deleteRelease: {
|
|
8455
|
+
title: string;
|
|
8456
|
+
description: string;
|
|
8457
|
+
inputParams: {
|
|
8458
|
+
spaceId: zod.ZodString;
|
|
8459
|
+
environmentId: zod.ZodString;
|
|
8460
|
+
} & {
|
|
8461
|
+
releaseId: zod.ZodString;
|
|
8462
|
+
confirm: zod.ZodOptional<zod.ZodBoolean>;
|
|
8463
|
+
confirmToken: zod.ZodOptional<zod.ZodString>;
|
|
8464
|
+
};
|
|
8465
|
+
annotations: {
|
|
8466
|
+
readOnlyHint: boolean;
|
|
8467
|
+
destructiveHint: boolean;
|
|
8468
|
+
idempotentHint: boolean;
|
|
8469
|
+
openWorldHint: boolean;
|
|
8470
|
+
};
|
|
8471
|
+
tool: (params: {
|
|
8472
|
+
spaceId: string;
|
|
8473
|
+
environmentId: string;
|
|
8474
|
+
releaseId: string;
|
|
8475
|
+
confirmToken?: string | undefined;
|
|
8476
|
+
confirm?: boolean | undefined;
|
|
8477
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8478
|
+
};
|
|
8479
|
+
publishRelease: {
|
|
8480
|
+
title: string;
|
|
8481
|
+
description: string;
|
|
8482
|
+
inputParams: {
|
|
8483
|
+
spaceId: zod.ZodString;
|
|
8484
|
+
environmentId: zod.ZodString;
|
|
8485
|
+
} & {
|
|
8486
|
+
releaseId: zod.ZodString;
|
|
8487
|
+
};
|
|
8488
|
+
annotations: {
|
|
8489
|
+
readOnlyHint: boolean;
|
|
8490
|
+
destructiveHint: boolean;
|
|
8491
|
+
idempotentHint: boolean;
|
|
8492
|
+
openWorldHint: boolean;
|
|
8493
|
+
};
|
|
8494
|
+
tool: (params: {
|
|
8495
|
+
spaceId: string;
|
|
8496
|
+
environmentId: string;
|
|
8497
|
+
releaseId: string;
|
|
8498
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8499
|
+
};
|
|
8500
|
+
unpublishRelease: {
|
|
8501
|
+
title: string;
|
|
8502
|
+
description: string;
|
|
8503
|
+
inputParams: {
|
|
8504
|
+
spaceId: zod.ZodString;
|
|
8505
|
+
environmentId: zod.ZodString;
|
|
8506
|
+
} & {
|
|
8507
|
+
releaseId: zod.ZodString;
|
|
8508
|
+
};
|
|
8509
|
+
annotations: {
|
|
8510
|
+
readOnlyHint: boolean;
|
|
8511
|
+
destructiveHint: boolean;
|
|
8512
|
+
idempotentHint: boolean;
|
|
8513
|
+
openWorldHint: boolean;
|
|
8514
|
+
};
|
|
8515
|
+
tool: (params: {
|
|
8516
|
+
spaceId: string;
|
|
8517
|
+
environmentId: string;
|
|
8518
|
+
releaseId: string;
|
|
8519
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8520
|
+
};
|
|
8521
|
+
validateRelease: {
|
|
8522
|
+
title: string;
|
|
8523
|
+
description: string;
|
|
8524
|
+
inputParams: {
|
|
8525
|
+
spaceId: zod.ZodString;
|
|
8526
|
+
environmentId: zod.ZodString;
|
|
8527
|
+
} & {
|
|
8528
|
+
releaseId: zod.ZodString;
|
|
8529
|
+
action: zod.ZodOptional<zod.ZodEnum<["publish", "unpublish"]>>;
|
|
8530
|
+
};
|
|
8531
|
+
annotations: {
|
|
8532
|
+
readOnlyHint: boolean;
|
|
8533
|
+
destructiveHint: boolean;
|
|
8534
|
+
idempotentHint: boolean;
|
|
8535
|
+
openWorldHint: boolean;
|
|
8536
|
+
};
|
|
8537
|
+
tool: (params: {
|
|
8538
|
+
spaceId: string;
|
|
8539
|
+
environmentId: string;
|
|
8540
|
+
releaseId: string;
|
|
8541
|
+
action?: "publish" | "unpublish" | undefined;
|
|
8542
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8543
|
+
};
|
|
8544
|
+
getReleaseAction: {
|
|
8545
|
+
title: string;
|
|
8546
|
+
description: string;
|
|
8547
|
+
inputParams: {
|
|
8548
|
+
spaceId: zod.ZodString;
|
|
8549
|
+
environmentId: zod.ZodString;
|
|
8550
|
+
} & {
|
|
8551
|
+
releaseId: zod.ZodString;
|
|
8552
|
+
actionId: zod.ZodString;
|
|
8553
|
+
};
|
|
8554
|
+
annotations: {
|
|
8555
|
+
readOnlyHint: boolean;
|
|
8556
|
+
destructiveHint: boolean;
|
|
8557
|
+
openWorldHint: boolean;
|
|
8558
|
+
};
|
|
8559
|
+
tool: (params: {
|
|
8560
|
+
spaceId: string;
|
|
8561
|
+
environmentId: string;
|
|
8562
|
+
releaseId: string;
|
|
8563
|
+
actionId: string;
|
|
8564
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8565
|
+
};
|
|
8566
|
+
listReleaseActions: {
|
|
8567
|
+
title: string;
|
|
8568
|
+
description: string;
|
|
8569
|
+
inputParams: {
|
|
8570
|
+
spaceId: zod.ZodString;
|
|
8571
|
+
environmentId: zod.ZodString;
|
|
8572
|
+
} & {
|
|
8573
|
+
releaseId: zod.ZodOptional<zod.ZodString>;
|
|
8574
|
+
action: zod.ZodOptional<zod.ZodEnum<["publish", "unpublish", "validate"]>>;
|
|
8575
|
+
statusIn: zod.ZodOptional<zod.ZodString>;
|
|
8576
|
+
statusNin: zod.ZodOptional<zod.ZodString>;
|
|
8577
|
+
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
8578
|
+
};
|
|
8579
|
+
annotations: {
|
|
8580
|
+
readOnlyHint: boolean;
|
|
8581
|
+
destructiveHint: boolean;
|
|
8582
|
+
openWorldHint: boolean;
|
|
8583
|
+
};
|
|
8584
|
+
tool: (params: {
|
|
8585
|
+
spaceId: string;
|
|
8586
|
+
environmentId: string;
|
|
8587
|
+
releaseId?: string | undefined;
|
|
8588
|
+
limit?: number | undefined;
|
|
8589
|
+
statusIn?: string | undefined;
|
|
8590
|
+
statusNin?: string | undefined;
|
|
8591
|
+
action?: "publish" | "unpublish" | "validate" | undefined;
|
|
8592
|
+
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
8593
|
+
};
|
|
8594
|
+
};
|
|
8324
8595
|
/**
|
|
8325
8596
|
* Get tag tools
|
|
8326
8597
|
*/
|
|
@@ -8911,7 +9182,7 @@ declare class ContentfulMcpTools {
|
|
|
8911
9182
|
description: string;
|
|
8912
9183
|
inputParams: {
|
|
8913
9184
|
organizationId: zod.ZodOptional<zod.ZodString>;
|
|
8914
|
-
metricKey: zod.ZodEnum<["api_call_cma", "api_call_cpa", "api_call_cda", "api_call_graphql", "asset_bandwidth", "functions_invocations", "ai_action_invocation", "ai_action_word_count", "ai_consumption_unit"]>;
|
|
9185
|
+
metricKey: zod.ZodEnum<["api_call_cma", "api_call_cpa", "api_call_cda", "api_call_graphql", "asset_bandwidth", "functions_invocations", "ai_action_invocation", "ai_action_word_count", "ai_consumption_unit", "monthly_active_profiles"]>;
|
|
8915
9186
|
dateGte: zod.ZodString;
|
|
8916
9187
|
dateLte: zod.ZodString;
|
|
8917
9188
|
granularity: zod.ZodOptional<zod.ZodEnum<["P1D", "P1M"]>>;
|
|
@@ -8927,7 +9198,7 @@ declare class ContentfulMcpTools {
|
|
|
8927
9198
|
openWorldHint: boolean;
|
|
8928
9199
|
};
|
|
8929
9200
|
tool: (params: {
|
|
8930
|
-
metricKey: "api_call_cma" | "api_call_cpa" | "api_call_cda" | "api_call_graphql" | "asset_bandwidth" | "functions_invocations" | "ai_action_invocation" | "ai_action_word_count" | "ai_consumption_unit";
|
|
9201
|
+
metricKey: "api_call_cma" | "api_call_cpa" | "api_call_cda" | "api_call_graphql" | "asset_bandwidth" | "functions_invocations" | "ai_action_invocation" | "ai_action_word_count" | "ai_consumption_unit" | "monthly_active_profiles";
|
|
8931
9202
|
dateGte: string;
|
|
8932
9203
|
dateLte: string;
|
|
8933
9204
|
filter?: Record<string, string | string[]> | undefined;
|
package/dist/index.js
CHANGED
|
@@ -392,7 +392,8 @@ var RESOURCE_DISPLAY_NAME = {
|
|
|
392
392
|
experienceFragment: "experience fragment",
|
|
393
393
|
experienceTemplate: "experience template",
|
|
394
394
|
dataAssembly: "data assembly",
|
|
395
|
-
designToken: "design token"
|
|
395
|
+
designToken: "design token",
|
|
396
|
+
release: "release"
|
|
396
397
|
};
|
|
397
398
|
function buildConfirmationPreview(resource, id, details, confirmToken) {
|
|
398
399
|
const displayName = RESOURCE_DISPLAY_NAME[resource];
|
|
@@ -5626,7 +5627,8 @@ var AGGREGATED_USAGE_METRIC_KEYS = [
|
|
|
5626
5627
|
"functions_invocations",
|
|
5627
5628
|
"ai_action_invocation",
|
|
5628
5629
|
"ai_action_word_count",
|
|
5629
|
-
"ai_consumption_unit"
|
|
5630
|
+
"ai_consumption_unit",
|
|
5631
|
+
"monthly_active_profiles"
|
|
5630
5632
|
];
|
|
5631
5633
|
var FilterValueSchema = z80.union([
|
|
5632
5634
|
z80.string().min(1),
|
|
@@ -5637,7 +5639,7 @@ var GetUsagesToolParams = z80.object({
|
|
|
5637
5639
|
"Organization ID. If omitted, falls back to the ORGANIZATION_ID configured on the server."
|
|
5638
5640
|
),
|
|
5639
5641
|
metricKey: z80.enum(AGGREGATED_USAGE_METRIC_KEYS).describe(
|
|
5640
|
-
'Metric to aggregate. Availability depends on the products enabled for the organization. Allowed dimensions per metric (used by "group", "filter", and "order", all in the form sys.dimensions.<name>.sys.<suffix>): api_call_cma / api_call_cpa / api_call_cda / api_call_graphql \u2192 sys.dimensions.space.sys.id. asset_bandwidth \u2192 sys.dimensions.space.sys.id, sys.dimensions.asset.sys.id. functions_invocations \u2192 sys.dimensions.space.sys.id, sys.dimensions.app.sys.id, sys.dimensions.function.sys.id. ai_action_invocation / ai_action_word_count / ai_consumption_unit \u2192 sys.dimensions.space.sys.id, sys.dimensions.ai_action.sys.id, sys.dimensions.model.sys.provider, sys.dimensions.model.sys.id.'
|
|
5642
|
+
'Metric to aggregate. Availability depends on the products enabled for the organization. Allowed dimensions per metric (used by "group", "filter", and "order", all in the form sys.dimensions.<name>.sys.<suffix>): api_call_cma / api_call_cpa / api_call_cda / api_call_graphql \u2192 sys.dimensions.space.sys.id. asset_bandwidth \u2192 sys.dimensions.space.sys.id, sys.dimensions.asset.sys.id. functions_invocations \u2192 sys.dimensions.space.sys.id, sys.dimensions.app.sys.id, sys.dimensions.function.sys.id. ai_action_invocation / ai_action_word_count / ai_consumption_unit \u2192 sys.dimensions.space.sys.id, sys.dimensions.ai_action.sys.id, sys.dimensions.model.sys.provider, sys.dimensions.model.sys.id. monthly_active_profiles (MAPs) has no dimensions \u2014 do not pass "group", "filter", or "order" with it. MAPs is calendar-month only: use granularity="P1M" ("P1D" is not meaningful for it).'
|
|
5641
5643
|
),
|
|
5642
5644
|
dateGte: z80.string().describe(
|
|
5643
5645
|
"Start date (inclusive) in ISO-8601 format (YYYY-MM-DD or full date-time). Sent as query param date[gte]. Max lookback: 12 months from now."
|
|
@@ -5704,7 +5706,8 @@ function getUsagesTool(config) {
|
|
|
5704
5706
|
limit: collection.limit,
|
|
5705
5707
|
skip: collection.skip,
|
|
5706
5708
|
metricKey,
|
|
5707
|
-
organizationId
|
|
5709
|
+
organizationId,
|
|
5710
|
+
dataLastUpdatedAt: collection.dataLastUpdatedAt
|
|
5708
5711
|
});
|
|
5709
5712
|
}
|
|
5710
5713
|
return withErrorHandling(tool2, "Error retrieving usage");
|
|
@@ -8767,6 +8770,501 @@ function createDesignTokenTools(config) {
|
|
|
8767
8770
|
};
|
|
8768
8771
|
}
|
|
8769
8772
|
|
|
8773
|
+
// src/tools/releases/listReleases.ts
|
|
8774
|
+
import { z as z128 } from "zod";
|
|
8775
|
+
var MAX_ITEMS = 10;
|
|
8776
|
+
var ListReleasesToolParams = BaseToolSchema.extend({
|
|
8777
|
+
limit: z128.number().optional().describe("Maximum number of releases to return (max 10)"),
|
|
8778
|
+
pageNext: z128.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8779
|
+
pagePrev: z128.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8780
|
+
statusIn: z128.string().optional().describe("Comma-separated list of statuses to include (active, archived)"),
|
|
8781
|
+
statusNin: z128.string().optional().describe("Comma-separated list of statuses to exclude (active, archived)"),
|
|
8782
|
+
titleMatch: z128.string().optional().describe("Full text phrase/term match on release title"),
|
|
8783
|
+
entitiesLinkType: z128.enum(["Entry", "Asset"]).optional().describe("Filter releases by the linked entity type (Entry or Asset)"),
|
|
8784
|
+
entitiesSysIdIn: z128.string().optional().describe(
|
|
8785
|
+
"Comma-separated list of entity IDs the release must contain. Requires entitiesLinkType."
|
|
8786
|
+
)
|
|
8787
|
+
});
|
|
8788
|
+
function listReleasesTool(config) {
|
|
8789
|
+
async function tool2(args) {
|
|
8790
|
+
if (args.entitiesSysIdIn && !args.entitiesLinkType) {
|
|
8791
|
+
throw new Error(
|
|
8792
|
+
"entitiesLinkType is required when entitiesSysIdIn is provided"
|
|
8793
|
+
);
|
|
8794
|
+
}
|
|
8795
|
+
const contentfulClient = createToolClient(config, args);
|
|
8796
|
+
const releases = await contentfulClient.release.query({
|
|
8797
|
+
spaceId: args.spaceId,
|
|
8798
|
+
environmentId: args.environmentId,
|
|
8799
|
+
query: {
|
|
8800
|
+
limit: Math.max(1, Math.min(args.limit ?? MAX_ITEMS, MAX_ITEMS)),
|
|
8801
|
+
...args.pageNext && { pageNext: args.pageNext },
|
|
8802
|
+
...args.pagePrev && { pagePrev: args.pagePrev },
|
|
8803
|
+
...args.statusIn && { "sys.status[in]": args.statusIn },
|
|
8804
|
+
...args.statusNin && { "sys.status[nin]": args.statusNin },
|
|
8805
|
+
...args.titleMatch && { "title[match]": args.titleMatch },
|
|
8806
|
+
...args.entitiesLinkType && {
|
|
8807
|
+
"entities.sys.linkType": args.entitiesLinkType
|
|
8808
|
+
},
|
|
8809
|
+
...args.entitiesSysIdIn && {
|
|
8810
|
+
"entities.sys.id[in]": args.entitiesSysIdIn
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
});
|
|
8814
|
+
const summarized = summarizeData(releases, {
|
|
8815
|
+
maxItems: MAX_ITEMS,
|
|
8816
|
+
remainingMessage: "To see more releases, ask me to retrieve the next page using the pageNext cursor."
|
|
8817
|
+
});
|
|
8818
|
+
return createSuccessResponse("Releases retrieved successfully", {
|
|
8819
|
+
releases: summarized,
|
|
8820
|
+
pages: releases.pages
|
|
8821
|
+
});
|
|
8822
|
+
}
|
|
8823
|
+
return withErrorHandling(tool2, "Error listing releases");
|
|
8824
|
+
}
|
|
8825
|
+
|
|
8826
|
+
// src/tools/releases/getRelease.ts
|
|
8827
|
+
import { z as z129 } from "zod";
|
|
8828
|
+
var GetReleaseToolParams = BaseToolSchema.extend({
|
|
8829
|
+
releaseId: z129.string().describe("The ID of the release to retrieve")
|
|
8830
|
+
});
|
|
8831
|
+
function getReleaseTool(config) {
|
|
8832
|
+
async function tool2(args) {
|
|
8833
|
+
const params = {
|
|
8834
|
+
spaceId: args.spaceId,
|
|
8835
|
+
environmentId: args.environmentId,
|
|
8836
|
+
releaseId: args.releaseId
|
|
8837
|
+
};
|
|
8838
|
+
const contentfulClient = createToolClient(config, args);
|
|
8839
|
+
const release = await contentfulClient.release.get(params);
|
|
8840
|
+
return createSuccessResponse("Release retrieved successfully", {
|
|
8841
|
+
release
|
|
8842
|
+
});
|
|
8843
|
+
}
|
|
8844
|
+
return withErrorHandling(tool2, "Error retrieving release");
|
|
8845
|
+
}
|
|
8846
|
+
|
|
8847
|
+
// src/tools/releases/createRelease.ts
|
|
8848
|
+
import { z as z131 } from "zod";
|
|
8849
|
+
|
|
8850
|
+
// src/tools/releases/releaseEntities.ts
|
|
8851
|
+
import { z as z130 } from "zod";
|
|
8852
|
+
var ReleaseEntityLinkSchema = z130.object({
|
|
8853
|
+
id: z130.string().describe("The ID of the Entry or Asset"),
|
|
8854
|
+
linkType: z130.enum(["Entry", "Asset"]).describe("The type of entity being linked")
|
|
8855
|
+
});
|
|
8856
|
+
function createReleaseEntities(entities) {
|
|
8857
|
+
return {
|
|
8858
|
+
sys: { type: "Array" },
|
|
8859
|
+
items: entities.map((entity) => ({
|
|
8860
|
+
sys: {
|
|
8861
|
+
type: "Link",
|
|
8862
|
+
linkType: entity.linkType,
|
|
8863
|
+
id: entity.id
|
|
8864
|
+
}
|
|
8865
|
+
}))
|
|
8866
|
+
};
|
|
8867
|
+
}
|
|
8868
|
+
|
|
8869
|
+
// src/tools/releases/createRelease.ts
|
|
8870
|
+
var CreateReleaseToolParams = BaseToolSchema.extend({
|
|
8871
|
+
title: z131.string().describe("The title of the release"),
|
|
8872
|
+
entities: z131.array(ReleaseEntityLinkSchema).describe("The Entries and/or Assets to include in the release")
|
|
8873
|
+
});
|
|
8874
|
+
function createReleaseTool(config) {
|
|
8875
|
+
async function tool2(args) {
|
|
8876
|
+
assertEnvironmentNotProtected(
|
|
8877
|
+
args.environmentId,
|
|
8878
|
+
config.protectedEnvironments
|
|
8879
|
+
);
|
|
8880
|
+
const contentfulClient = createToolClient(config, args);
|
|
8881
|
+
const release = await contentfulClient.release.create(
|
|
8882
|
+
{
|
|
8883
|
+
spaceId: args.spaceId,
|
|
8884
|
+
environmentId: args.environmentId
|
|
8885
|
+
},
|
|
8886
|
+
{
|
|
8887
|
+
title: args.title,
|
|
8888
|
+
entities: createReleaseEntities(args.entities)
|
|
8889
|
+
}
|
|
8890
|
+
);
|
|
8891
|
+
return createSuccessResponse("Release created successfully", { release });
|
|
8892
|
+
}
|
|
8893
|
+
return withErrorHandling(tool2, "Error creating release");
|
|
8894
|
+
}
|
|
8895
|
+
|
|
8896
|
+
// src/tools/releases/updateRelease.ts
|
|
8897
|
+
import { z as z132 } from "zod";
|
|
8898
|
+
var UpdateReleaseToolParams = BaseToolSchema.extend({
|
|
8899
|
+
releaseId: z132.string().describe("The ID of the release to update"),
|
|
8900
|
+
title: z132.string().optional().describe("The new title of the release. Omit to keep the existing title."),
|
|
8901
|
+
entities: z132.array(ReleaseEntityLinkSchema).optional().describe(
|
|
8902
|
+
"The full replacement list of Entries/Assets for the release. Omit to keep the existing entities."
|
|
8903
|
+
)
|
|
8904
|
+
});
|
|
8905
|
+
function updateReleaseTool(config) {
|
|
8906
|
+
async function tool2(args) {
|
|
8907
|
+
assertEnvironmentNotProtected(
|
|
8908
|
+
args.environmentId,
|
|
8909
|
+
config.protectedEnvironments
|
|
8910
|
+
);
|
|
8911
|
+
const params = {
|
|
8912
|
+
spaceId: args.spaceId,
|
|
8913
|
+
environmentId: args.environmentId,
|
|
8914
|
+
releaseId: args.releaseId
|
|
8915
|
+
};
|
|
8916
|
+
const contentfulClient = createToolClient(config, args);
|
|
8917
|
+
const existingRelease = await contentfulClient.release.get(params);
|
|
8918
|
+
const entities = args.entities ? createReleaseEntities(args.entities) : existingRelease.entities;
|
|
8919
|
+
const updatedRelease = await contentfulClient.release.update(
|
|
8920
|
+
{ ...params, version: existingRelease.sys.version },
|
|
8921
|
+
{
|
|
8922
|
+
title: args.title ?? existingRelease.title,
|
|
8923
|
+
entities
|
|
8924
|
+
}
|
|
8925
|
+
);
|
|
8926
|
+
return createSuccessResponse("Release updated successfully", {
|
|
8927
|
+
release: updatedRelease
|
|
8928
|
+
});
|
|
8929
|
+
}
|
|
8930
|
+
return withErrorHandling(tool2, "Error updating release");
|
|
8931
|
+
}
|
|
8932
|
+
|
|
8933
|
+
// src/tools/releases/deleteRelease.ts
|
|
8934
|
+
import { z as z133 } from "zod";
|
|
8935
|
+
var DeleteReleaseToolParams = BaseToolSchema.extend({
|
|
8936
|
+
releaseId: z133.string().describe("The ID of the release to delete"),
|
|
8937
|
+
confirm: z133.boolean().optional().describe(
|
|
8938
|
+
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
8939
|
+
),
|
|
8940
|
+
confirmToken: z133.string().optional().describe(
|
|
8941
|
+
"Token returned by the preview call; must be supplied with confirm: true."
|
|
8942
|
+
)
|
|
8943
|
+
});
|
|
8944
|
+
function deleteReleaseTool(config) {
|
|
8945
|
+
async function tool2(args) {
|
|
8946
|
+
assertEnvironmentNotProtected(
|
|
8947
|
+
args.environmentId,
|
|
8948
|
+
config.protectedEnvironments
|
|
8949
|
+
);
|
|
8950
|
+
const params = {
|
|
8951
|
+
spaceId: args.spaceId,
|
|
8952
|
+
environmentId: args.environmentId,
|
|
8953
|
+
releaseId: args.releaseId
|
|
8954
|
+
};
|
|
8955
|
+
const contentfulClient = createToolClient(config, args);
|
|
8956
|
+
const release = await contentfulClient.release.get(params);
|
|
8957
|
+
const expectedToken = buildConfirmToken(
|
|
8958
|
+
"release",
|
|
8959
|
+
args.releaseId,
|
|
8960
|
+
release.sys.version
|
|
8961
|
+
);
|
|
8962
|
+
if (args.confirm !== true || args.confirmToken !== expectedToken) {
|
|
8963
|
+
const preview = buildConfirmationPreview(
|
|
8964
|
+
"release",
|
|
8965
|
+
args.releaseId,
|
|
8966
|
+
{ release },
|
|
8967
|
+
expectedToken
|
|
8968
|
+
);
|
|
8969
|
+
return createSuccessResponse(`${CONFIRMATION_MESSAGE_PREFIX} release`, {
|
|
8970
|
+
...preview,
|
|
8971
|
+
instructions: `${preview.instructions} Deleting a release also permanently deletes all ReleaseActions linked to it.`
|
|
8972
|
+
});
|
|
8973
|
+
}
|
|
8974
|
+
await contentfulClient.release.delete(params);
|
|
8975
|
+
return createSuccessResponse("Release deleted successfully", { release });
|
|
8976
|
+
}
|
|
8977
|
+
return withErrorHandling(tool2, "Error deleting release");
|
|
8978
|
+
}
|
|
8979
|
+
|
|
8980
|
+
// src/tools/releases/publishRelease.ts
|
|
8981
|
+
import { z as z134 } from "zod";
|
|
8982
|
+
var PublishReleaseToolParams = BaseToolSchema.extend({
|
|
8983
|
+
releaseId: z134.string().describe("The ID of the release to publish")
|
|
8984
|
+
});
|
|
8985
|
+
function publishReleaseTool(config) {
|
|
8986
|
+
async function tool2(args) {
|
|
8987
|
+
assertEnvironmentNotProtected(
|
|
8988
|
+
args.environmentId,
|
|
8989
|
+
config.protectedEnvironments
|
|
8990
|
+
);
|
|
8991
|
+
const params = {
|
|
8992
|
+
spaceId: args.spaceId,
|
|
8993
|
+
environmentId: args.environmentId,
|
|
8994
|
+
releaseId: args.releaseId
|
|
8995
|
+
};
|
|
8996
|
+
const contentfulClient = createToolClient(config, args);
|
|
8997
|
+
const release = await contentfulClient.release.get(params);
|
|
8998
|
+
const releaseAction = await contentfulClient.release.publish({
|
|
8999
|
+
...params,
|
|
9000
|
+
version: release.sys.version
|
|
9001
|
+
});
|
|
9002
|
+
return createSuccessResponse("Release publish queued", {
|
|
9003
|
+
actionId: releaseAction.sys.id,
|
|
9004
|
+
status: releaseAction.sys.status,
|
|
9005
|
+
releaseId: args.releaseId,
|
|
9006
|
+
note: "Use get_release_action with this actionId to check whether the publish succeeded."
|
|
9007
|
+
});
|
|
9008
|
+
}
|
|
9009
|
+
return withErrorHandling(tool2, "Error publishing release");
|
|
9010
|
+
}
|
|
9011
|
+
|
|
9012
|
+
// src/tools/releases/unpublishRelease.ts
|
|
9013
|
+
import { z as z135 } from "zod";
|
|
9014
|
+
var UnpublishReleaseToolParams = BaseToolSchema.extend({
|
|
9015
|
+
releaseId: z135.string().describe("The ID of the release to unpublish")
|
|
9016
|
+
});
|
|
9017
|
+
function unpublishReleaseTool(config) {
|
|
9018
|
+
async function tool2(args) {
|
|
9019
|
+
assertEnvironmentNotProtected(
|
|
9020
|
+
args.environmentId,
|
|
9021
|
+
config.protectedEnvironments
|
|
9022
|
+
);
|
|
9023
|
+
const params = {
|
|
9024
|
+
spaceId: args.spaceId,
|
|
9025
|
+
environmentId: args.environmentId,
|
|
9026
|
+
releaseId: args.releaseId
|
|
9027
|
+
};
|
|
9028
|
+
const contentfulClient = createToolClient(config, args);
|
|
9029
|
+
const release = await contentfulClient.release.get(params);
|
|
9030
|
+
const releaseAction = await contentfulClient.release.unpublish({
|
|
9031
|
+
...params,
|
|
9032
|
+
version: release.sys.version
|
|
9033
|
+
});
|
|
9034
|
+
return createSuccessResponse("Release unpublish queued", {
|
|
9035
|
+
actionId: releaseAction.sys.id,
|
|
9036
|
+
status: releaseAction.sys.status,
|
|
9037
|
+
releaseId: args.releaseId,
|
|
9038
|
+
note: "Use get_release_action with this actionId to check whether the unpublish succeeded."
|
|
9039
|
+
});
|
|
9040
|
+
}
|
|
9041
|
+
return withErrorHandling(tool2, "Error unpublishing release");
|
|
9042
|
+
}
|
|
9043
|
+
|
|
9044
|
+
// src/tools/releases/validateRelease.ts
|
|
9045
|
+
import { z as z136 } from "zod";
|
|
9046
|
+
var ValidateReleaseToolParams = BaseToolSchema.extend({
|
|
9047
|
+
releaseId: z136.string().describe("The ID of the release to validate"),
|
|
9048
|
+
action: z136.enum(["publish", "unpublish"]).optional().describe(
|
|
9049
|
+
"The downstream action to validate the release against. Omit to run a general validation."
|
|
9050
|
+
)
|
|
9051
|
+
});
|
|
9052
|
+
function validateReleaseTool(config) {
|
|
9053
|
+
async function tool2(args) {
|
|
9054
|
+
const params = {
|
|
9055
|
+
spaceId: args.spaceId,
|
|
9056
|
+
environmentId: args.environmentId,
|
|
9057
|
+
releaseId: args.releaseId
|
|
9058
|
+
};
|
|
9059
|
+
const contentfulClient = createToolClient(config, args);
|
|
9060
|
+
const releaseAction = await contentfulClient.release.validate(
|
|
9061
|
+
params,
|
|
9062
|
+
args.action ? { action: args.action } : void 0
|
|
9063
|
+
);
|
|
9064
|
+
return createSuccessResponse("Release validation queued", {
|
|
9065
|
+
actionId: releaseAction.sys.id,
|
|
9066
|
+
status: releaseAction.sys.status,
|
|
9067
|
+
releaseId: args.releaseId,
|
|
9068
|
+
note: "Use get_release_action with this actionId to check whether validation succeeded."
|
|
9069
|
+
});
|
|
9070
|
+
}
|
|
9071
|
+
return withErrorHandling(tool2, "Error validating release");
|
|
9072
|
+
}
|
|
9073
|
+
|
|
9074
|
+
// src/tools/releases/getReleaseAction.ts
|
|
9075
|
+
import { z as z137 } from "zod";
|
|
9076
|
+
var GetReleaseActionToolParams = BaseToolSchema.extend({
|
|
9077
|
+
releaseId: z137.string().describe("The ID of the release the action belongs to"),
|
|
9078
|
+
actionId: z137.string().describe("The ID of the release action to retrieve")
|
|
9079
|
+
});
|
|
9080
|
+
function getReleaseActionTool(config) {
|
|
9081
|
+
async function tool2(args) {
|
|
9082
|
+
const params = {
|
|
9083
|
+
spaceId: args.spaceId,
|
|
9084
|
+
environmentId: args.environmentId,
|
|
9085
|
+
releaseId: args.releaseId,
|
|
9086
|
+
actionId: args.actionId
|
|
9087
|
+
};
|
|
9088
|
+
const contentfulClient = createToolClient(config, args);
|
|
9089
|
+
const releaseAction = await contentfulClient.releaseAction.get(params);
|
|
9090
|
+
return createSuccessResponse("Release action retrieved successfully", {
|
|
9091
|
+
releaseAction
|
|
9092
|
+
});
|
|
9093
|
+
}
|
|
9094
|
+
return withErrorHandling(tool2, "Error retrieving release action");
|
|
9095
|
+
}
|
|
9096
|
+
|
|
9097
|
+
// src/tools/releases/listReleaseActions.ts
|
|
9098
|
+
import { z as z138 } from "zod";
|
|
9099
|
+
var MAX_ITEMS2 = 10;
|
|
9100
|
+
var ListReleaseActionsToolParams = BaseToolSchema.extend({
|
|
9101
|
+
releaseId: z138.string().optional().describe("Comma-separated list of release IDs to filter actions by"),
|
|
9102
|
+
action: z138.enum(["publish", "unpublish", "validate"]).optional().describe("Filter by release action type"),
|
|
9103
|
+
statusIn: z138.string().optional().describe(
|
|
9104
|
+
"Comma-separated list of statuses to include (created, inProgress, succeeded, failed)"
|
|
9105
|
+
),
|
|
9106
|
+
statusNin: z138.string().optional().describe(
|
|
9107
|
+
"Comma-separated list of statuses to exclude (created, inProgress, succeeded, failed)"
|
|
9108
|
+
),
|
|
9109
|
+
limit: z138.number().optional().describe("Maximum number of release actions to return")
|
|
9110
|
+
});
|
|
9111
|
+
function listReleaseActionsTool(config) {
|
|
9112
|
+
async function tool2(args) {
|
|
9113
|
+
const contentfulClient = createToolClient(config, args);
|
|
9114
|
+
const releaseActions = await contentfulClient.releaseAction.getMany({
|
|
9115
|
+
spaceId: args.spaceId,
|
|
9116
|
+
environmentId: args.environmentId,
|
|
9117
|
+
query: {
|
|
9118
|
+
limit: Math.max(1, Math.min(args.limit ?? MAX_ITEMS2, MAX_ITEMS2)),
|
|
9119
|
+
...args.releaseId && { "sys.release.sys.id[in]": args.releaseId },
|
|
9120
|
+
...args.action && { action: args.action },
|
|
9121
|
+
...args.statusIn && { "sys.status[in]": args.statusIn },
|
|
9122
|
+
...args.statusNin && { "sys.status[nin]": args.statusNin }
|
|
9123
|
+
}
|
|
9124
|
+
});
|
|
9125
|
+
const summarized = summarizeData(releaseActions, {
|
|
9126
|
+
maxItems: MAX_ITEMS2,
|
|
9127
|
+
remainingMessage: "To see more release actions, narrow your filters or ask for a smaller limit."
|
|
9128
|
+
});
|
|
9129
|
+
return createSuccessResponse("Release actions retrieved successfully", {
|
|
9130
|
+
releaseActions: summarized
|
|
9131
|
+
});
|
|
9132
|
+
}
|
|
9133
|
+
return withErrorHandling(tool2, "Error listing release actions");
|
|
9134
|
+
}
|
|
9135
|
+
|
|
9136
|
+
// src/tools/releases/register.ts
|
|
9137
|
+
function createReleaseTools(config) {
|
|
9138
|
+
const listReleases = listReleasesTool(config);
|
|
9139
|
+
const getRelease = getReleaseTool(config);
|
|
9140
|
+
const createRelease = createReleaseTool(config);
|
|
9141
|
+
const updateRelease = updateReleaseTool(config);
|
|
9142
|
+
const deleteRelease = deleteReleaseTool(config);
|
|
9143
|
+
const publishRelease = publishReleaseTool(config);
|
|
9144
|
+
const unpublishRelease = unpublishReleaseTool(config);
|
|
9145
|
+
const validateRelease = validateReleaseTool(config);
|
|
9146
|
+
const getReleaseAction = getReleaseActionTool(config);
|
|
9147
|
+
const listReleaseActions = listReleaseActionsTool(config);
|
|
9148
|
+
return {
|
|
9149
|
+
listReleases: {
|
|
9150
|
+
title: "list_releases",
|
|
9151
|
+
description: "List releases in a space/environment. Returns a maximum of 10 items per request. Use pageNext/pagePrev cursors to paginate through results.",
|
|
9152
|
+
inputParams: ListReleasesToolParams.shape,
|
|
9153
|
+
annotations: {
|
|
9154
|
+
readOnlyHint: true,
|
|
9155
|
+
destructiveHint: false,
|
|
9156
|
+
openWorldHint: false
|
|
9157
|
+
},
|
|
9158
|
+
tool: listReleases
|
|
9159
|
+
},
|
|
9160
|
+
getRelease: {
|
|
9161
|
+
title: "get_release",
|
|
9162
|
+
description: "Retrieve a release",
|
|
9163
|
+
inputParams: GetReleaseToolParams.shape,
|
|
9164
|
+
annotations: {
|
|
9165
|
+
readOnlyHint: true,
|
|
9166
|
+
destructiveHint: false,
|
|
9167
|
+
openWorldHint: false
|
|
9168
|
+
},
|
|
9169
|
+
tool: getRelease
|
|
9170
|
+
},
|
|
9171
|
+
createRelease: {
|
|
9172
|
+
title: "create_release",
|
|
9173
|
+
description: "Create a release with a title and a set of Entries/Assets to include in it.",
|
|
9174
|
+
inputParams: CreateReleaseToolParams.shape,
|
|
9175
|
+
annotations: {
|
|
9176
|
+
readOnlyHint: false,
|
|
9177
|
+
destructiveHint: false,
|
|
9178
|
+
idempotentHint: false,
|
|
9179
|
+
openWorldHint: false
|
|
9180
|
+
},
|
|
9181
|
+
tool: createRelease
|
|
9182
|
+
},
|
|
9183
|
+
updateRelease: {
|
|
9184
|
+
title: "update_release",
|
|
9185
|
+
description: "Update a release's title and/or the Entries/Assets it contains. Omitted fields keep their current value.",
|
|
9186
|
+
inputParams: UpdateReleaseToolParams.shape,
|
|
9187
|
+
annotations: {
|
|
9188
|
+
readOnlyHint: false,
|
|
9189
|
+
destructiveHint: false,
|
|
9190
|
+
idempotentHint: false,
|
|
9191
|
+
openWorldHint: false
|
|
9192
|
+
},
|
|
9193
|
+
tool: updateRelease
|
|
9194
|
+
},
|
|
9195
|
+
deleteRelease: {
|
|
9196
|
+
title: "delete_release",
|
|
9197
|
+
description: "Delete a release. This is a two-phase operation: the first call (without confirm/confirmToken) returns a preview of the release and a confirmToken. To complete the deletion, call this tool again with the same releaseId, confirm: true, and the confirmToken from the preview response. Deleting a release also permanently deletes all ReleaseActions linked to it.",
|
|
9198
|
+
inputParams: DeleteReleaseToolParams.shape,
|
|
9199
|
+
annotations: {
|
|
9200
|
+
readOnlyHint: false,
|
|
9201
|
+
destructiveHint: true,
|
|
9202
|
+
idempotentHint: false,
|
|
9203
|
+
openWorldHint: false
|
|
9204
|
+
},
|
|
9205
|
+
tool: deleteRelease
|
|
9206
|
+
},
|
|
9207
|
+
publishRelease: {
|
|
9208
|
+
title: "publish_release",
|
|
9209
|
+
description: "Publish a release. Publishing is asynchronous: this tool returns as soon as the publish is queued (status created/inProgress), not once it completes. Use get_release_action with the returned actionId to check the outcome.",
|
|
9210
|
+
inputParams: PublishReleaseToolParams.shape,
|
|
9211
|
+
annotations: {
|
|
9212
|
+
readOnlyHint: false,
|
|
9213
|
+
destructiveHint: true,
|
|
9214
|
+
idempotentHint: true,
|
|
9215
|
+
openWorldHint: false
|
|
9216
|
+
},
|
|
9217
|
+
tool: publishRelease
|
|
9218
|
+
},
|
|
9219
|
+
unpublishRelease: {
|
|
9220
|
+
title: "unpublish_release",
|
|
9221
|
+
description: "Unpublish a release. Unpublishing is asynchronous: this tool returns as soon as the unpublish is queued (status created/inProgress), not once it completes. Use get_release_action with the returned actionId to check the outcome.",
|
|
9222
|
+
inputParams: UnpublishReleaseToolParams.shape,
|
|
9223
|
+
annotations: {
|
|
9224
|
+
readOnlyHint: false,
|
|
9225
|
+
destructiveHint: true,
|
|
9226
|
+
idempotentHint: true,
|
|
9227
|
+
openWorldHint: false
|
|
9228
|
+
},
|
|
9229
|
+
tool: unpublishRelease
|
|
9230
|
+
},
|
|
9231
|
+
validateRelease: {
|
|
9232
|
+
title: "validate_release",
|
|
9233
|
+
description: "Validate a release, optionally against a specific downstream action (publish or unpublish). Validation is asynchronous: this tool returns as soon as validation is queued (status created/inProgress), not once it completes. Use get_release_action with the returned actionId to check the outcome.",
|
|
9234
|
+
inputParams: ValidateReleaseToolParams.shape,
|
|
9235
|
+
annotations: {
|
|
9236
|
+
readOnlyHint: false,
|
|
9237
|
+
destructiveHint: false,
|
|
9238
|
+
idempotentHint: true,
|
|
9239
|
+
openWorldHint: false
|
|
9240
|
+
},
|
|
9241
|
+
tool: validateRelease
|
|
9242
|
+
},
|
|
9243
|
+
getReleaseAction: {
|
|
9244
|
+
title: "get_release_action",
|
|
9245
|
+
description: "Retrieve a release action by ID to check the status (created, inProgress, succeeded, failed) of a previously queued publish, unpublish, or validate operation.",
|
|
9246
|
+
inputParams: GetReleaseActionToolParams.shape,
|
|
9247
|
+
annotations: {
|
|
9248
|
+
readOnlyHint: true,
|
|
9249
|
+
destructiveHint: false,
|
|
9250
|
+
openWorldHint: false
|
|
9251
|
+
},
|
|
9252
|
+
tool: getReleaseAction
|
|
9253
|
+
},
|
|
9254
|
+
listReleaseActions: {
|
|
9255
|
+
title: "list_release_actions",
|
|
9256
|
+
description: "List release actions in a space/environment. Returns a maximum of 10 items per request. Optionally filter by release ID, action type (publish/unpublish/validate), or status.",
|
|
9257
|
+
inputParams: ListReleaseActionsToolParams.shape,
|
|
9258
|
+
annotations: {
|
|
9259
|
+
readOnlyHint: true,
|
|
9260
|
+
destructiveHint: false,
|
|
9261
|
+
openWorldHint: false
|
|
9262
|
+
},
|
|
9263
|
+
tool: listReleaseActions
|
|
9264
|
+
}
|
|
9265
|
+
};
|
|
9266
|
+
}
|
|
9267
|
+
|
|
8770
9268
|
// src/ContentfulMcpTools.ts
|
|
8771
9269
|
var ContentfulMcpTools = class {
|
|
8772
9270
|
config;
|
|
@@ -8869,6 +9367,12 @@ var ContentfulMcpTools = class {
|
|
|
8869
9367
|
getSpaceTools() {
|
|
8870
9368
|
return createSpaceTools(this.config);
|
|
8871
9369
|
}
|
|
9370
|
+
/**
|
|
9371
|
+
* Get release tools
|
|
9372
|
+
*/
|
|
9373
|
+
getReleaseTools() {
|
|
9374
|
+
return createReleaseTools(this.config);
|
|
9375
|
+
}
|
|
8872
9376
|
/**
|
|
8873
9377
|
* Get tag tools
|
|
8874
9378
|
*/
|