Skip to main content
Glama
webflow

Webflow

Official
by webflow

Designer Element Tool

element_tool

Manage and modify elements on Webflow pages by selecting, updating attributes, setting text, styles, links, and images.

Instructions

Designer Tool - Element tool to perform actions like get all elements, get selected element, select element on current active page. and more

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

  • The handler function that executes the 'element_tool' logic by proxying to the RPC call.
    async ({ actions, siteId }) => {
      try {
        return formatResponse(await elementToolRPCCall(siteId, actions));
      } catch (error) {
        return formatErrorResponse(error);
      }
    }
  • Zod input schema defining the structure for element_tool actions including get_all_elements, select_element, add_or_update_attribute, etc.
    inputSchema: z.object({
      ...SiteIdSchema,
      actions: z.array(
        z.object({
          get_all_elements: z
            .object({
              query: z.enum(["all"]).describe("Query to get all elements"),
              include_style_properties: z
                .boolean()
                .optional()
                .describe("Include style properties"),
              include_all_breakpoint_styles: z
                .boolean()
                .optional()
                .describe("Include all breakpoints styles"),
            })
            .optional()
            .describe("Get all elements on the current active page"),
          get_selected_element: z
            .boolean()
            .optional()
            .describe("Get selected element on the current active page"),
          select_element: z
            .object({
              ...DEElementIDSchema,
            })
            .optional()
            .describe("Select an element on the current active page"),
          add_or_update_attribute: z
            .object({
              ...DEElementIDSchema,
              attributes: z
                .array(
                  z.object({
                    name: z
                      .string()
                      .describe(
                        "The name of the attribute to add or update."
                      ),
                    value: z
                      .string()
                      .describe(
                        "The value of the attribute to add or update."
                      ),
                  })
                )
                .describe("The attributes to add or update."),
            })
            .optional()
            .describe("Add or update an attribute on the element"),
          remove_attribute: z
            .object({
              ...DEElementIDSchema,
              attribute_names: z
                .array(z.string())
                .describe("The names of the attributes to remove."),
            })
            .optional()
            .describe("Remove an attribute from the element"),
          update_id_attribute: z
            .object({
              ...DEElementIDSchema,
              new_id: z
                .string()
                .describe(
                  "The new #id of the element to update the id attribute to."
                ),
            })
            .optional()
            .describe("Update the #id attribute of the element"),
          set_text: z
            .object({
              ...DEElementIDSchema,
              text: z.string().describe("The text to set on the element."),
            })
            .optional()
            .describe("Set text on the element"),
          set_style: z
            .object({
              ...DEElementIDSchema,
              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_link: z
            .object({
              ...DEElementIDSchema,
              linkType: z
                .enum(["url", "file", "page", "element", "email", "phone"])
                .describe("The type of the link to update."),
              link: z
                .string()
                .describe(
                  "The link to set on the element. for page pass page id, for element pass json string of id object. e.g id:{component:123,element:456}. for email pass email address. for phone pass phone number. for file pass asset id. for url pass url."
                ),
            })
            .optional()
            .describe("Set link on the element"),
          set_heading_level: z
            .object({
              ...DEElementIDSchema,
              heading_level: z
                .number()
                .min(1)
                .max(6)
                .describe("The heading level to set on the element. 1 to 6."),
            })
            .optional()
            .describe("Set heading level on the heading element."),
          set_image_asset: z
            .object({
              ...DEElementIDSchema,
              image_asset_id: z
                .string()
                .describe("The image asset id to set on the element."),
            })
            .optional()
            .describe("Set image asset on the image element"),
        })
      ),
    }),
  • Registration of the 'element_tool' on the MCP server with title, description, input schema, and handler.
    server.registerTool(
      "element_tool",
      {
        title: "Designer Element Tool",
        description:
          "Designer Tool - Element tool to perform actions like get all elements, get selected element, select element on current active page. and more",
        inputSchema: z.object({
          ...SiteIdSchema,
          actions: z.array(
            z.object({
              get_all_elements: z
                .object({
                  query: z.enum(["all"]).describe("Query to get all elements"),
                  include_style_properties: z
                    .boolean()
                    .optional()
                    .describe("Include style properties"),
                  include_all_breakpoint_styles: z
                    .boolean()
                    .optional()
                    .describe("Include all breakpoints styles"),
                })
                .optional()
                .describe("Get all elements on the current active page"),
              get_selected_element: z
                .boolean()
                .optional()
                .describe("Get selected element on the current active page"),
              select_element: z
                .object({
                  ...DEElementIDSchema,
                })
                .optional()
                .describe("Select an element on the current active page"),
              add_or_update_attribute: z
                .object({
                  ...DEElementIDSchema,
                  attributes: z
                    .array(
                      z.object({
                        name: z
                          .string()
                          .describe(
                            "The name of the attribute to add or update."
                          ),
                        value: z
                          .string()
                          .describe(
                            "The value of the attribute to add or update."
                          ),
                      })
                    )
                    .describe("The attributes to add or update."),
                })
                .optional()
                .describe("Add or update an attribute on the element"),
              remove_attribute: z
                .object({
                  ...DEElementIDSchema,
                  attribute_names: z
                    .array(z.string())
                    .describe("The names of the attributes to remove."),
                })
                .optional()
                .describe("Remove an attribute from the element"),
              update_id_attribute: z
                .object({
                  ...DEElementIDSchema,
                  new_id: z
                    .string()
                    .describe(
                      "The new #id of the element to update the id attribute to."
                    ),
                })
                .optional()
                .describe("Update the #id attribute of the element"),
              set_text: z
                .object({
                  ...DEElementIDSchema,
                  text: z.string().describe("The text to set on the element."),
                })
                .optional()
                .describe("Set text on the element"),
              set_style: z
                .object({
                  ...DEElementIDSchema,
                  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_link: z
                .object({
                  ...DEElementIDSchema,
                  linkType: z
                    .enum(["url", "file", "page", "element", "email", "phone"])
                    .describe("The type of the link to update."),
                  link: z
                    .string()
                    .describe(
                      "The link to set on the element. for page pass page id, for element pass json string of id object. e.g id:{component:123,element:456}. for email pass email address. for phone pass phone number. for file pass asset id. for url pass url."
                    ),
                })
                .optional()
                .describe("Set link on the element"),
              set_heading_level: z
                .object({
                  ...DEElementIDSchema,
                  heading_level: z
                    .number()
                    .min(1)
                    .max(6)
                    .describe("The heading level to set on the element. 1 to 6."),
                })
                .optional()
                .describe("Set heading level on the heading element."),
              set_image_asset: z
                .object({
                  ...DEElementIDSchema,
                  image_asset_id: z
                    .string()
                    .describe("The image asset id to set on the element."),
                })
                .optional()
                .describe("Set image asset on the image element"),
            })
          ),
        }),
      },
      async ({ actions, siteId }) => {
        try {
          return formatResponse(await elementToolRPCCall(siteId, actions));
        } catch (error) {
          return formatErrorResponse(error);
        }
      }
    );
  • src/mcp.ts:62-62 (registration)
    Top-level call to register DEElementTools, which includes element_tool, in the designer tools group.
    registerDEElementTools(server, rpc);
  • Helper function to make RPC call to the underlying 'element_tool' implementation.
    const elementToolRPCCall = async (siteId: string, actions: any) => {
      return rpc.callTool("element_tool", {
        siteId,
        actions: actions || [],
      });
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but fails to do so adequately. It mentions actions like 'select element' and 'add or update attribute' but doesn't clarify whether these are read-only or mutative operations, what permissions are required, or how changes affect the system. The description is too high-level to inform the agent about behavioral traits.

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

Conciseness3/5

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

The description is a single run-on sentence that lists examples but lacks structure. While it's brief, the phrase 'and more' is vague and doesn't add value. It could be more front-loaded with a clear purpose statement. The conciseness is adequate but not optimal for quick understanding.

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 (multiple nested actions, no annotations, no output schema), the description is insufficient. It doesn't explain the tool's scope, return values, error conditions, or how actions interact. For a multi-function tool with rich input schema but no other structured data, the description should provide more context to guide the agent effectively.

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?

The description provides no parameter-specific information beyond the high-level action names. However, the input schema has 50% description coverage, detailing parameters like 'siteId' and nested action objects (e.g., 'get_all_elements', 'select_element'). Since the schema does substantial documentation work, the baseline score of 3 is appropriate, though the description adds no additional parameter semantics.

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

Purpose2/5

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

The description states the tool performs actions on elements but is vague about its specific purpose. It lists examples like 'get all elements, get selected element, select element' but doesn't clearly define what the tool fundamentally does or how it differs from sibling tools like 'element_builder' or 'style_tool'. The phrase 'and more' adds ambiguity rather than clarity.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing an active page), exclusions, or comparisons with sibling tools like 'element_builder' or 'style_tool'. The input schema hints at needing a siteId, but the description itself offers no usage context.

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