collections_items_create_item_live
Create and publish new CMS collection items directly to your live Webflow site. Add content to collections and make it immediately visible to visitors.
Instructions
Create and publish new items in a CMS collection directly to the live site.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | Unique identifier for the Collection. | |
| request | Yes |
Implementation Reference
- src/tools/cms.ts:216-241 (registration)Full registration of the 'collections_items_create_item_live' tool, including name, input schema using WebflowCollectionsItemsCreateItemLiveRequestSchema, and inline handler function that calls the Webflow API to create item live.server.registerTool( "collections_items_create_item_live", { title: "Create Item Live", description: "Create and publish new items in a CMS collection directly to the live site.", inputSchema: z.object({ collection_id: z .string() .describe("Unique identifier for the Collection."), request: WebflowCollectionsItemsCreateItemLiveRequestSchema, }), }, async ({ collection_id, request }) => { try { const response = await getClient().collections.items.createItemLive( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } } );
- src/tools/cms.ts:229-240 (handler)The inline handler function for the tool that performs the actual API call to create and publish a CMS item live using the Webflow client.async ({ collection_id, request }) => { try { const response = await getClient().collections.items.createItemLive( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } }
- Zod schema defining the input structure for the createItemLive request, including items array with fields like fieldData, name, slug, etc.export const WebflowCollectionsItemsCreateItemLiveRequestSchema = z.object({ items: z .array( z.object({ id: z.string().optional(), cmsLocaleId: z .string() .optional() .describe("Unique identifier for the locale of the CMS Item."), lastPublished: z .string() .optional() .describe("Date when the item was last published."), lastUpdated: z .string() .optional() .describe("Date when the item was last updated."), createdOn: z .string() .optional() .describe("Date when the item was created."), isArchived: z .boolean() .optional() .describe("Indicates if the item is archived."), isDraft: z .boolean() .optional() .describe("Indicates if the item is a draft."), fieldData: z.record(z.any()).and( z.object({ name: z.string().describe("Name of the field."), slug: z .string() .describe( "URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug." ), }) ), }) ) .optional() .describe("Array of items to be created."), });