collections_items_delete_item
Delete a specific item from a Webflow CMS collection by providing the collection ID and item ID. Optionally specify a locale ID to delete from non-primary locales.
Instructions
Delete an item in a CMS collection. Items will only be deleted in the primary locale unless a cmsLocaleId is included in the request.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | Unique identifier for the Collection. | |
| itemId | Yes | Item ID to be deleted. | |
| cmsLocaleIds | No | Unique identifier for the locale of the CMS Item. |
Implementation Reference
- src/tools/cms.ts:441-453 (handler)Handler function that deletes a CMS collection item by calling the Webflow API's deleteItem method.async ({ collection_id, itemId, cmsLocaleIds }) => { try { const response = await getClient().collections.items.deleteItem( collection_id, itemId, { cmsLocaleId: cmsLocaleIds }, requestOptions ); return formatResponse(JSON.stringify("Item deleted")); } catch (error) { return formatErrorResponse(error); } }
- src/tools/cms.ts:430-439 (schema)Zod input schema defining parameters for the delete item tool: collection_id, itemId, and optional cmsLocaleIds.inputSchema: z.object({ collection_id: z .string() .describe("Unique identifier for the Collection."), itemId: z.string().describe("Item ID to be deleted."), cmsLocaleIds: z .string() .optional() .describe("Unique identifier for the locale of the CMS Item."), }),
- src/tools/cms.ts:424-454 (registration)Tool registration call for 'collections_items_delete_item' including schema, description, and inline handler.server.registerTool( "collections_items_delete_item", { title: "Delete Collection Item", description: "Delete an item in a CMS collection. Items will only be deleted in the primary locale unless a cmsLocaleId is included in the request. ", inputSchema: z.object({ collection_id: z .string() .describe("Unique identifier for the Collection."), itemId: z.string().describe("Item ID to be deleted."), cmsLocaleIds: z .string() .optional() .describe("Unique identifier for the locale of the CMS Item."), }), }, async ({ collection_id, itemId, cmsLocaleIds }) => { try { const response = await getClient().collections.items.deleteItem( collection_id, itemId, { cmsLocaleId: cmsLocaleIds }, requestOptions ); return formatResponse(JSON.stringify("Item deleted")); } catch (error) { return formatErrorResponse(error); } } );