Skip to main content
Glama
webflow

Webflow

Official
by webflow

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
NameRequiredDescriptionDefault
site_idYesUnique identifier for the Site.
component_idYesUnique identifier for the Component.
localeIdYesUnique identifier for a specific locale. Applicable when using localization.
nodesYes

Implementation Reference

  • 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);
      }
    }
  • 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();
  • 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,
    }),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/webflow/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server