Skip to main content
Glama
webflow

Webflow

Official
by webflow

Designer Element Builder

element_builder

Create and structure web elements on active Webflow pages using a hierarchical approach with up to three nesting levels for building complex layouts.

Instructions

Designer Tool - Element builder to create element on current active page. only create elements upto max 3 levels deep. divide your elements into smaller elements to create complex structures. recall this tool to create more elements. but max level is upto 3 levels. you can have as many children as you want. but max level is 3 levels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesThe ID of the site. DO NOT ASSUME site id. ALWAYS ask user for site id if not already provided or known. use sites_list tool to fetch all sites and then ask user to select one of them.
actionsYes

Implementation Reference

  • Registration of the MCP tool 'element_builder' with detailed input schema supporting creation of elements up to 3 levels deep, and a handler that proxies the request to an RPC call using elementBuilderRPCCall.
    server.registerTool(
      "element_builder",
      {
        title: "Designer Element Builder",
        description:
          "Designer Tool - Element builder to create element on current active page. only create elements upto max 3 levels deep. divide your elements into smaller elements to create complex structures. recall this tool to create more elements. but max level is upto 3 levels. you can have as many children as you want. but max level is 3 levels.",
        inputSchema: z.object({
          ...SiteIdSchema,
          actions: z.array(
            z.object({
              parent_element_id: z
                .object({
                  component: z
                    .string()
                    .describe(
                      "The component id of the element to perform action on."
                    ),
                  element: z
                    .string()
                    .describe(
                      "The element id of the element to perform action on."
                    ),
                })
                .describe(
                  "The id of the parent element to create element on, you can find it from id field on element. e.g id:{component:123,element:456}."
                ),
              creation_position: z
                .enum(["append", "prepend"])
                .describe(
                  "The position to create element on. append to the end of the parent element or prepend to the beginning of the parent element. as child of the parent element."
                ),
              element_schema: DEElementSchema.extend({
                children: z
                  .array(
                    DEElementSchema.extend({
                      children: z
                        .array(
                          DEElementSchema.extend({
                            children: z
                              .array(
                                DEElementSchema.extend({
                                  children: z.array(DEElementSchema).optional(),
                                })
                              )
                              .optional(),
                          })
                        )
                        .optional(),
                    })
                  )
                  .optional()
                  .describe(
                    "The children of the element. only valid for container, section, div block, valid DOM elements."
                  ),
              }).describe("element schema of element to create."),
            })
          ),
        }),
      },
      async ({ actions, siteId }) => {
        try {
          return formatResponse(await elementBuilderRPCCall(siteId, actions));
        } catch (error) {
          return formatErrorResponse(error);
        }
      }
    );
  • Handler function for the 'element_builder' tool, which formats and forwards the actions to the RPC proxy function, handling errors.
    async ({ actions, siteId }) => {
      try {
        return formatResponse(await elementBuilderRPCCall(siteId, actions));
      } catch (error) {
        return formatErrorResponse(error);
      }
    }
  • Helper RPC proxy function that calls the underlying 'element_builder' tool via rpc.callTool.
    const elementBuilderRPCCall = async (siteId: string, actions: any) => {
      return rpc.callTool("element_builder", {
        siteId,
        actions: actions || [],
      });
    };
  • Base schema DEElementSchema defining structure for elements created by element_builder, including type, styles, text, links, etc., extended in the tool inputSchema for up to 3 levels of nesting.
    import { z } from "zod/v3";
    
    export const DEElementSchema = z.object({
      type: z
        .enum([
          "Container",
          "Section",
          "DivBlock",
          "Heading",
          "TextBlock",
          "Paragraph",
          "Button",
          "TextLink",
          "LinkBlock",
          "Image",
          "DOM",
        ])
        .describe(
          "The type of element to create. with DOM type you can create any element. make sure you pass dom_config if you are creating a DOM element."
        ),
      set_style: z
        .object({
          style_names: z
            .array(z.string())
            .describe("The style names to set on the element."),
        })
        .optional()
        .describe(
          "Set style on the element. it will remove all other styles on the element. and set only the styles passed in style_names."
        ),
      set_text: z
        .object({
          text: z.string().describe("The text to set on the element."),
        })
        .optional()
        .describe(
          "Set text on the element. only valid for text block, paragraph, heading, button, text link, link block."
        ),
      set_link: z
        .object({
          link_type: z
            .enum(["url", "file", "page", "element", "email", "phone"])
            .describe("The type of link to set on the element."),
          link: z.string().describe("The link to set on the element."),
        })
        .optional()
        .describe(
          "Set link on the element. only valid for button, text link, link block."
        ),
      set_heading_level: z
        .object({
          heading_level: z
            .number()
            .min(1)
            .max(6)
            .describe("The heading level to set on the element."),
        })
        .optional()
        .describe("Set heading level on the element. only valid for heading."),
      set_image_asset: z
        .object({
          image_asset_id: z
            .string()
            .describe("The image asset id to set on the element."),
          alt_text: z
            .string()
            .optional()
            .describe(
              "The alt text to set on the image. if not provided it will inherit from the image asset."
            ),
        })
        .optional()
        .describe("Set image asset on the element. only valid for image."),
      set_dom_config: z
        .object({
          dom_tag: z
            .string()
            .describe(
              "The tag of the DOM element to create. for example span, code, etc."
            ),
        })
        .optional()
        .describe("Set DOM config on the element. only valid for DOM element."),
      set_attributes: z
        .object({
          attributes: z
            .array(
              z.object({
                name: z.string().describe("The name of the attribute to set."),
                value: z.string().describe("The value of the attribute to set."),
              })
            )
            .describe("The attributes to set on the element."),
        })
        .optional()
        .describe("Set attributes on the element."),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses some behavioral traits: the 3-level depth constraint, ability to create 'as many children as you want', and that it's for the 'current active page'. However, it doesn't mention whether this is a destructive operation, what permissions are needed, error conditions, or what happens if limits are exceeded. For a complex creation tool, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is repetitive ('max level is upto 3 levels' appears twice) and poorly structured. It's a single run-on sentence with unclear organization. While it contains useful information, the presentation is inefficient and could be significantly improved with better formatting and elimination of redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (nested creation with multiple element types), no annotations, no output schema, and only 50% schema description coverage, the description is inadequate. It doesn't explain what happens after creation, how to reference created elements, error handling, or provide examples. For such a sophisticated tool, much more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, so the description must compensate. The description mentions no parameters directly, focusing instead on usage patterns and constraints. It doesn't explain what 'siteId' or 'actions' represent, nor does it clarify the complex nested structure. The schema does heavy lifting with detailed parameter descriptions, but the description adds little semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'create element on current active page' with specific constraints about depth ('max 3 levels deep'). It distinguishes from siblings by focusing on element creation rather than other operations like updating or deleting. However, it doesn't explicitly differentiate from 'element_tool' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage guidance: 'divide your elements into smaller elements to create complex structures' and 'recall this tool to create more elements'. It implies when to use it (for building nested structures) but doesn't explicitly state when NOT to use it or mention alternatives among the many sibling tools. The guidance is helpful but incomplete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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