collection_fields_create_static
Add custom static fields like text, numbers, dates, or images to Webflow CMS collections to structure content with specific data types and requirements.
Instructions
Create a new static field in a CMS collection (e.g., text, number, date, etc.).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | Unique identifier for the Collection. | |
| request | Yes |
Implementation Reference
- src/tools/cms.ts:114-124 (handler)The handler function that executes the tool logic by calling the Webflow API to create a static field in a collection.async ({ collection_id, request }) => { try { const response = await getClient().collections.fields.create( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); }
- src/tools/cms.ts:102-126 (registration)Registers the 'collection_fields_create_static' tool with the MCP server, defining its title, description, input schema, and handler."collection_fields_create_static", { title: "Create Static Field", description: "Create a new static field in a CMS collection (e.g., text, number, date, etc.).", inputSchema: z.object({ collection_id: z .string() .describe("Unique identifier for the Collection."), request: StaticFieldSchema, }), }, async ({ collection_id, request }) => { try { const response = await getClient().collections.fields.create( collection_id, request, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } } );
- Zod schema defining the input parameters for creating a static field (e.g., type, name, required status).export const StaticFieldSchema = z.object({ id: z.string().optional().describe("Unique identifier for the Field."), isEditable: z .boolean() .optional() .describe("Indicates if the field is editable."), isRequired: z .boolean() .optional() .describe("Indicates if the field is required."), type: z .union([ z.literal("Color"), z.literal("DateTime"), z.literal("Email"), z.literal("File"), z.literal("Image"), z.literal("Link"), z.literal("MultiImage"), z.literal("Number"), z.literal("Phone"), z.literal("PlainText"), z.literal("RichText"), z.literal("Switch"), z.literal("Video"), ]) .describe("Type of the field. Choose of these appropriate field types."), displayName: z.string().describe("Name of the field."), helpText: z.string().optional().describe("Help text for the field."), });
- src/mcp.ts:49-49 (registration)Calls registerCmsTools within the main registerTools function, which registers all CMS tools including collection_fields_create_static.registerCmsTools(server, getClient);