Skip to main content
Glama

delete_element

Remove elements from a Revit model by specifying their element IDs. This tool enables deletion of one or multiple elements to modify project designs.

Instructions

Delete one or more elements from the Revit model by their element IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYesThe IDs of the elements to delete

Implementation Reference

  • The handler function that processes the tool call: extracts elementIds, sends 'delete_element' command to Revit client using withRevitConnection, and returns the response or error message.
    async (args, extra) => {
      const params = {
        elementIds: args.elementIds,
      };
    
      try {
        const response = await withRevitConnection(async (revitClient) => {
          return await revitClient.sendCommand("delete_element", params);
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `delete element failed: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
        };
      }
    }
  • Input schema definition using Zod: requires 'elementIds' as an array of strings.
    {
      elementIds: z
        .array(z.string())
        .describe("The IDs of the elements to delete"),
    },
  • The registration function that adds the 'delete_element' tool to the MCP server, including name, description, schema, and handler. This function is dynamically called during server setup from src/tools/register.ts.
    export function registerDeleteElementTool(server: McpServer) {
      server.tool(
        "delete_element",
        "Delete one or more elements from the Revit model by their element IDs.",
        {
          elementIds: z
            .array(z.string())
            .describe("The IDs of the elements to delete"),
        },
        async (args, extra) => {
          const params = {
            elementIds: args.elementIds,
          };
    
          try {
            const response = await withRevitConnection(async (revitClient) => {
              return await revitClient.sendCommand("delete_element", params);
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(response, null, 2),
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `delete 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, the description carries full burden but only states the basic action. It doesn't disclose critical behavioral traits such as whether deletion is permanent, requires specific permissions, affects model integrity, or has side effects. This is inadequate for a destructive operation.

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?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of a destructive operation, no annotations, and no output schema, the description is incomplete. It lacks information on behavior, consequences, or return values, which is insufficient for safe and effective use by an agent.

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%, with the parameter 'elementIds' fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format details or examples, so it meets the baseline for high coverage.

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 action ('Delete') and target ('elements from the Revit model by their element IDs'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'operate_element' or 'ai_element_filter', which might also involve element manipulation, so it doesn't reach the highest score.

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. It doesn't mention prerequisites (e.g., needing an open document), exclusions, or comparisons to siblings like 'operate_element' or 'get_selected_elements', leaving the agent without context for selection.

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

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