diff --git a/README.md b/README.md index f80bfce..cbcc215 100644 --- a/README.md +++ b/README.md @@ -217,9 +217,11 @@ collection - fields - update; // Update a custom field collections - items - create - item - live; // Create items collections - items - update - items - live; // Update items collections - items - list - items; // List collection items +collections - items - get - item; // Get a specific collection item collections - items - create - item; // Create collection items (staged) collections - items - update - items; // Update collection items (staged) collections - items - publish - items; // Publish collection items +collections - items - delete - item; // Delete a collection item ``` ### Custom Code diff --git a/src/tools/cms.ts b/src/tools/cms.ts index c511b79..d4e54b2 100644 --- a/src/tools/cms.ts +++ b/src/tools/cms.ts @@ -295,6 +295,39 @@ export function registerCmsTools( } ); + // GET https://api.webflow.com/v2/collections/:collection_id/items/:item_id + server.tool( + "collections_items_get_item", + "Get a specific item from a CMS collection by its ID.", + { + collection_id: z + .string() + .describe("Unique identifier for the Collection."), + item_id: z + .string() + .describe("Unique identifier for the Item."), + cmsLocaleId: z + .string() + .optional() + .describe("Unique identifier for the locale of the CMS Item."), + }, + async ({ collection_id, item_id, cmsLocaleId }) => { + try { + const response = await getClient().collections.items.getItem( + collection_id, + item_id, + { + cmsLocaleId, + }, + requestOptions + ); + return formatResponse(response); + } catch (error) { + return formatErrorResponse(error); + } + } + ); + // POST https://api.webflow.com/v2/collections/:collection_id/items server.tool( "collections_items_create_item",