collections_items_create_item
Create and add new items to a specific collection in Webflow using the collection ID and item details, including field data, CMS locale, and publication status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | ||
| request | Yes |
Implementation Reference
- src/tools/cms.ts:299-318 (registration)Registration of the 'collections_items_create_item' tool, including input schema reference and handler function.server.tool( "collections_items_create_item", "Create new items in a CMS collection as drafts.", { collection_id: z.string(), request: WebflowCollectionsItemsCreateItemRequestSchema, }, async ({ collection_id, request }) => { try { const response = await getClient().collections.items.createItem( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } } );
- src/tools/cms.ts:306-317 (handler)The handler function that executes the tool logic by calling Webflow API to create CMS items.async ({ collection_id, request }) => { try { const response = await getClient().collections.items.createItem( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } }
- Zod input schema defining the structure for creating CMS items (array of items).export const WebflowCollectionsItemsCreateItemRequestSchema = z.object({ items: z.array(CollectionItemPostSingleSchema).optional(), });