components_update_content
Modify text and property overrides for components in secondary locales to update localized content across Webflow sites.
Instructions
Update content on a component in secondary locales by modifying text nodes and property overrides.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | Unique identifier for the Site. | |
| component_id | Yes | Unique identifier for the Component. | |
| localeId | Yes | Unique identifier for a specific locale. Applicable when using localization. | |
| nodes | Yes |
Implementation Reference
- src/tools/components.ts:126-141 (handler)The handler function that executes the tool logic by calling the Webflow API's components.updateContent method with the provided parameters and handling the response or error.async ({ site_id, component_id, localeId, nodes }) => { try { const response = await getClient().components.updateContent( site_id, component_id, { localeId, nodes, }, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } }
- src/tools/components.ts:107-142 (registration)Registers the 'components_update_content' tool with the MCP server, specifying title, description, input schema, and the handler function.server.registerTool( "components_update_content", { title: "Update Component Content", description: "Update content on a component in secondary locales by modifying text nodes and property overrides.", inputSchema: z.object({ site_id: z.string().describe("Unique identifier for the Site."), component_id: z .string() .describe("Unique identifier for the Component."), localeId: z .string() .describe( "Unique identifier for a specific locale. Applicable when using localization." ), nodes: ComponentDomWriteNodesItemSchema, }), }, async ({ site_id, component_id, localeId, nodes }) => { try { const response = await getClient().components.updateContent( site_id, component_id, { localeId, nodes, }, requestOptions ); return formatResponse(response); } catch (error) { return formatErrorResponse(error); } } );
- Zod schema defining the structure for 'nodes' parameter: an array of either text node updates or property overrides for component content updates.export const ComponentDomWriteNodesItemSchema = z .union([ z .object({ nodeId: z.string().describe("Unique identifier for the node."), text: z .string() .describe("HTML content of the node, including the HTML tag."), }) .describe("Text node to be updated."), z .object({ nodeId: z.string().describe("Unique identifier for the node."), propertyOverrides: z .array( z.object({ propertyId: z .string() .describe("Unique identifier for the property."), text: z .string() .describe("Value used to override a component property."), }) ) .describe( "Properties to override for this locale's component instances." ), }) .describe("Update text property overrides of a component instance."), ]) .array();
- src/tools/components.ts:113-124 (schema)Inline Zod input schema for the tool, composing site_id, component_id, localeId, and nodes using the imported ComponentDomWriteNodesItemSchema.inputSchema: z.object({ site_id: z.string().describe("Unique identifier for the Site."), component_id: z .string() .describe("Unique identifier for the Component."), localeId: z .string() .describe( "Unique identifier for a specific locale. Applicable when using localization." ), nodes: ComponentDomWriteNodesItemSchema, }),