Skip to main content
Glama

get_elements

Retrieve elements from Revit models by specifying categories, views, or levels to access and analyze building information data.

Instructions

获取 Revit 模型中的元素

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdsNo需要获取的元素所属类别的Id集合
viewIdsNo需要获取的元素所处的视图的Id集合
levelIdsNo需要获取的元素所处的标高的Id集合

Implementation Reference

  • src/index.ts:140-158 (registration)
    Registration of the 'get_elements' tool including name, description, and input schema in ListToolsRequestSchema.
    name: "get_elements",
    description: "获取 Revit 模型中的元素",
    inputSchema: {
      type: "object",
      properties: {
        categoryIds: {
          type: "array",
          description: "需要获取的元素所属类别的Id集合"
        },
        viewIds: {
          type: "array",
          description: "需要获取的元素所处的视图的Id集合"
        },
        levelIds: {
          type: "array",
          description: "需要获取的元素所处的标高的Id集合"
        }
      }
    }
  • Dynamic dispatching in CallToolRequestSchema handler that maps 'get_elements' to revitService.getElements and invokes it.
    // 将工具名称转换为 camelCase 方法名
    const methodName = toolName.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
    
    // 检查 RevitService 是否有对应的方法
    if (typeof (this.revitService as any)[methodName] !== 'function') {
      throw new McpError(
        ErrorCode.MethodNotFound,
        `未知工具: ${toolName}`
      );
    }
    
    try {
      // 动态调用对应的方法
      const result = await (this.revitService as any)[methodName](request.params.arguments || {});
  • Core handler method in RevitService that forwards get_elements request to the RevitSocketClient.
    async getElements(args: GetElementsArgs): Promise<RevitElement[]> {
      
    
      try {
        return await this.client.getElements(args);
      } catch (error) {
        console.error('[RevitService] 获取元素失败,使用模拟数据:', error);
        throw error; // 不使用模拟数据,直接抛出错误
      }
    }
  • Socket client method that sends the 'get_elements' command with arguments to the Revit plugin.
    public async getElements(args: GetElementsArgs): Promise<RevitElement[]> {
      const response = await this.sendRequest<RevitElement[]>('get_elements', args);
      return response;
    }
  • Type definition for GetElementsArgs used in the handler signatures.
    export interface GetElementsArgs {
      category?: string;
      family?: string;
      type?: string;
      level?: string;
      limit?: number;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic action ('获取' - get) without detailing permissions, rate limits, pagination, or what 'elements' entail (e.g., geometric data, properties). For a tool with 3 parameters and no output schema, this is a significant gap in behavioral context.

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: '获取 Revit 模型中的元素' (Get elements from Revit model). It's front-loaded with the core action and resource, with zero wasted words. This is appropriately concise for a tool with good schema coverage, though it could benefit from more detail.

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 (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'elements' are, how results are returned, or the tool's behavior (e.g., filtering logic). With no output schema and minimal description, the agent lacks sufficient context to use the tool effectively beyond basic parameter input.

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 100%, with clear descriptions for each parameter (categoryIds, viewIds, levelIds). The description adds no additional meaning beyond the schema, such as explaining how parameters interact or providing examples. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.

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

Purpose3/5

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

The description states the purpose as '获取 Revit 模型中的元素' (Get elements from Revit model), which is clear but vague. It specifies the verb ('获取' - get) and resource ('元素' - elements) but lacks specificity about scope or type of elements, and doesn't differentiate from sibling tools like 'get_element_info' or 'get_families'. The description is functional but minimal.

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 sibling tools like 'get_element_info' (which might provide detailed info) or 'get_families' (which might filter by family type), nor does it specify prerequisites or contexts for usage. This leaves the agent without direction on tool 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/PiggyAndrew/revit_mcp'

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