Skip to main content
Glama

create_line_based_element

Create line-based elements like walls, beams, or pipes in Revit by specifying coordinates, dimensions, and parameters for batch modeling tasks.

Instructions

Create one or more line-based elements in Revit such as walls, beams, or pipes. Supports batch creation with detailed parameters including family type ID, start and end points, thickness, height, and level information. All units are in millimeters (mm).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesArray of line-based elements to create

Implementation Reference

  • The handler function that executes the tool logic by forwarding parameters to the Revit client using sendCommand.
      async (args, extra) => {
        const params = args;
    
        try {
          const response = await withRevitConnection(async (revitClient) => {
            return await revitClient.sendCommand(
              "create_line_based_element",
              params
            );
          });
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Create line-based element failed: ${
                  error instanceof Error ? error.message : String(error)
                }`,
              },
            ],
          };
        }
      }
    );
  • Input schema using Zod for validating the array of line-based element parameters.
    {
      data: z
        .array(
          z.object({
            name: z
              .string()
              .describe("Description of the element (e.g., wall, beam)"),
            typeId: z
              .number()
              .optional()
              .describe("The ID of the family type to create."),
            locationLine: z
              .object({
                p0: z.object({
                  x: z.number().describe("X coordinate of start point"),
                  y: z.number().describe("Y coordinate of start point"),
                  z: z.number().describe("Z coordinate of start point"),
                }),
                p1: z.object({
                  x: z.number().describe("X coordinate of end point"),
                  y: z.number().describe("Y coordinate of end point"),
                  z: z.number().describe("Z coordinate of end point"),
                }),
              })
              .describe("The line defining the element's location"),
            thickness: z
              .number()
              .describe(
                "Thickness/width of the element (e.g., wall thickness)"
              ),
            height: z
              .number()
              .describe("Height of the element (e.g., wall height)"),
            baseLevel: z.number().describe("Base level height"),
            baseOffset: z.number().describe("Offset from the base level"),
          })
        )
        .describe("Array of line-based elements to create"),
    },
  • Registration function that sets up the tool on the MCP server with name, description, schema, and handler.
    export function registerCreateLineBasedElementTool(server: McpServer) {
      server.tool(
        "create_line_based_element",
        "Create one or more line-based elements in Revit such as walls, beams, or pipes. Supports batch creation with detailed parameters including family type ID, start and end points, thickness, height, and level information. All units are in millimeters (mm).",
        {
          data: z
            .array(
              z.object({
                name: z
                  .string()
                  .describe("Description of the element (e.g., wall, beam)"),
                typeId: z
                  .number()
                  .optional()
                  .describe("The ID of the family type to create."),
                locationLine: z
                  .object({
                    p0: z.object({
                      x: z.number().describe("X coordinate of start point"),
                      y: z.number().describe("Y coordinate of start point"),
                      z: z.number().describe("Z coordinate of start point"),
                    }),
                    p1: z.object({
                      x: z.number().describe("X coordinate of end point"),
                      y: z.number().describe("Y coordinate of end point"),
                      z: z.number().describe("Z coordinate of end point"),
                    }),
                  })
                  .describe("The line defining the element's location"),
                thickness: z
                  .number()
                  .describe(
                    "Thickness/width of the element (e.g., wall thickness)"
                  ),
                height: z
                  .number()
                  .describe("Height of the element (e.g., wall height)"),
                baseLevel: z.number().describe("Base level height"),
                baseOffset: z.number().describe("Offset from the base level"),
              })
            )
            .describe("Array of line-based elements to create"),
        },
        async (args, extra) => {
          const params = args;
    
          try {
            const response = await withRevitConnection(async (revitClient) => {
              return await revitClient.sendCommand(
                "create_line_based_element",
                params
              );
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(response, null, 2),
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Create line-based element failed: ${
                    error instanceof Error ? error.message : String(error)
                  }`,
                },
              ],
            };
          }
        }
      );
    }
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. It states the tool 'creates' elements, implying a write operation, and mentions batch creation and units (mm), but fails to cover critical aspects like required permissions, whether changes are reversible, error handling, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first. It uses two sentences efficiently to cover creation, examples, batch support, parameters, and units, with no wasted words. However, it could be slightly more structured by separating usage guidelines from parameter details.

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 (a mutation tool for creating Revit elements with multiple nested parameters), no annotations, and no output schema, the description is incomplete. It covers the what and some how (parameters, units) but misses behavioral context like permissions, side effects, and return values. For such a tool, more comprehensive guidance is needed.

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 schema description coverage is 100%, so the schema already documents the single parameter ('data') and its nested properties thoroughly. The description adds marginal value by listing examples of parameters (e.g., family type ID, start/end points) and specifying units (mm), but doesn't provide additional syntax or format details beyond what the schema provides. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('create') and resource ('line-based elements in Revit such as walls, beams, or pipes'), making the purpose evident. It distinguishes from siblings like 'create_point_based_element' and 'create_surface_based_element' by specifying 'line-based', but doesn't explicitly contrast them. The specificity is good but could be more comparative.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'line-based elements' but doesn't explain when to choose this over 'create_point_based_element' or 'create_surface_based_element', nor does it discuss prerequisites or exclusions. Usage is implied by the resource type, but explicit context is lacking.

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/mcp-servers-for-revit/revit-mcp'

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