Skip to main content
Glama

create_point_based_element

Create point-based elements like doors and windows in Revit by specifying family type, position, dimensions, and level data in millimeters.

Instructions

Create one or more point-based elements in Revit such as doors, windows, or furniture. Supports batch creation with detailed parameters including family type ID, position, dimensions, and level information. All units are in millimeters (mm).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesArray of point-based elements to create

Implementation Reference

  • The tool handler function that validates args, establishes Revit connection using withRevitConnection, sends the create_point_based_element command to the Revit client, and formats the response or error.
    async (args, extra) => {
      const params = args;
    
      try {
        const response = await withRevitConnection(async (revitClient) => {
          return await revitClient.sendCommand(
            "create_point_based_element",
            params
          );
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Create point-based element failed: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the tool: an array of objects each specifying name, typeId, locationPoint (x,y,z), width, depth, height, baseLevel, baseOffset, and rotation.
    data: z
      .array(
        z.object({
          name: z
            .string()
            .describe("Description of the element (e.g., door, window)"),
          typeId: z
            .number()
            .optional()
            .describe("The ID of the family type to create."),
          locationPoint: z
            .object({
              x: z.number().describe("X coordinate"),
              y: z.number().describe("Y coordinate"),
              z: z.number().describe("Z coordinate"),
            })
            .describe(
              "The position coordinates where the element will be placed"
            ),
          width: z.number().describe("Width of the element in mm"),
          depth: z.number().optional().describe("Depth of the element in mm"),
          height: z.number().describe("Height of the element in mm"),
          baseLevel: z.number().describe("Base level height"),
          baseOffset: z.number().describe("Offset from the base level"),
          rotation: z
            .number()
            .optional()
            .describe("Rotation angle in degrees (0-360)"),
        })
      )
      .describe("Array of point-based elements to create"),
  • Function that registers the 'create_point_based_element' tool on the McpServer, providing name, description, input schema, and handler function.
    export function registerCreatePointBasedElementTool(server: McpServer) {
      server.tool(
        "create_point_based_element",
        "Create one or more point-based elements in Revit such as doors, windows, or furniture. Supports batch creation with detailed parameters including family type ID, position, dimensions, and level information. All units are in millimeters (mm).",
        {
          data: z
            .array(
              z.object({
                name: z
                  .string()
                  .describe("Description of the element (e.g., door, window)"),
                typeId: z
                  .number()
                  .optional()
                  .describe("The ID of the family type to create."),
                locationPoint: z
                  .object({
                    x: z.number().describe("X coordinate"),
                    y: z.number().describe("Y coordinate"),
                    z: z.number().describe("Z coordinate"),
                  })
                  .describe(
                    "The position coordinates where the element will be placed"
                  ),
                width: z.number().describe("Width of the element in mm"),
                depth: z.number().optional().describe("Depth of the element in mm"),
                height: z.number().describe("Height of the element in mm"),
                baseLevel: z.number().describe("Base level height"),
                baseOffset: z.number().describe("Offset from the base level"),
                rotation: z
                  .number()
                  .optional()
                  .describe("Rotation angle in degrees (0-360)"),
              })
            )
            .describe("Array of point-based elements to create"),
        },
        async (args, extra) => {
          const params = args;
    
          try {
            const response = await withRevitConnection(async (revitClient) => {
              return await revitClient.sendCommand(
                "create_point_based_element",
                params
              );
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(response, null, 2),
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Create point-based element failed: ${
                    error instanceof Error ? error.message : String(error)
                  }`,
                },
              ],
            };
          }
        }
      );
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the safety burden. It states the operation (create) and units, but does not explain side effects, required permissions, error behavior, or return values. It is minimal yet not misleading.

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

Conciseness5/5

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

Two sentences, front-loaded with the core purpose, and no filler. Every sentence contributes meaningful information.

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

Completeness4/5

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

The tool has a well-defined schema with one parameter, and the description covers the key purpose, batch capability, and units. It does not describe return values or error cases, but for a create tool this is acceptable.

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

Parameters4/5

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

The schema covers all parameter descriptions (100% coverage), so the baseline is 3. The description adds unit context ('All units are in millimeters') which is helpful, though slightly inaccurate since rotation is in degrees per the schema.

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

Purpose5/5

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

The description clearly states the tool creates point-based elements in Revit with examples (doors, windows, furniture). The 'point-based' modifier distinguishes it from sibling line-based and surface-based tools.

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

Usage Guidelines4/5

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

The description mentions batch creation and detailed parameters, implying use for creating one or more elements at once. It does not explicitly state when not to use, but the sibling tool names provide context for differentiation.

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