Skip to main content
Glama

get_element_info

Retrieve detailed information about Revit elements, including properties and parameters, by specifying the element ID to analyze model components.

Instructions

获取 Revit 元素的详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdYes元素的 ID
getItemPropertyInfoNo是否获取元素属性信息
getItemParameterInfoNo是否获取元素参数信息

Implementation Reference

  • The main handler method for the 'get_element_info' tool in the RevitService class. It delegates the request to the RevitSocketClient.
    async getElementInfo(args: GetElementInfoArgs): Promise<any> {
      try {
        return await this.client.getElementInfo(args);
      } catch (error) {
        console.error('[RevitService] 获取元素信息失败:', error);
        throw error;
      }
    }
  • Socket client handler that sends the 'get_element_info' command with arguments to the Revit plugin via socket.
    public async getElementInfo(args: GetElementInfoArgs): Promise<any> {
      return await this.sendRequest('get_element_info', args);
    }
  • src/index.ts:175-197 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and input schema.
      name: "get_element_info",
      description: "获取 Revit 元素的详细信息",
      inputSchema: {
        type: "object",
        properties: {
          elementId: {
            type: "string",
            description: "元素的 ID"
          },
          getItemPropertyInfo: {
            type: "boolean",
            description: "是否获取元素属性信息",
            default: true
          },
          getItemParameterInfo: {
            type: "boolean",
            description: "是否获取元素参数信息",
            default: false
          }
        },
        required: ["elementId"]
      }
    }]
  • TypeScript interface defining the input arguments for get_element_info, used in service and client classes.
    export interface GetElementInfoArgs {
      elementId: string;
      getItemPropertyInfo?: boolean;
      getItemParameterInfo?: boolean;
    }
  • Generic MCP CallToolRequestSchema handler that dynamically dispatches to RevitService methods based on tool name (e.g., 'get_element_info' -> getElementInfo).
        CallToolRequestSchema,
        async (request) => {
          // 获取工具名称
          const toolName = request.params.name;
    
          // 将工具名称转换为 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 || {});
            //const result = '';
            return {
              content: [{
                type: "text",
                text: JSON.stringify(result, null, 2)
              }]
            };
          } catch (error) {
            return {
              content: [{
                type: "text",
                text: `Revit API 错误: ${error instanceof Error ? error.message : String(error)}`
              }],
              isError: true,
            }
          }
        }
      );
    }
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 states the tool 'gets' information, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured data, or handles errors. This leaves significant behavioral gaps for an agent to rely on.

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, clear sentence in Chinese that directly states the tool's purpose without any unnecessary words or fluff. It's appropriately sized and front-loaded, making it efficient and easy to understand.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what '详细信息' (detailed information) entails, such as the format or content of the returned data, nor does it cover behavioral aspects like error handling. For a tool with parameters and no structured output, more context 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%, with all parameters clearly documented in the input schema. The description doesn't add any additional meaning or context beyond what the schema provides, such as explaining the relationship between the boolean parameters. This meets the baseline for high schema 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 ('获取' meaning 'get') and resource ('Revit 元素的详细信息' meaning 'detailed information of Revit elements'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_elements' or 'get_families' which might also retrieve element-related information, 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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_elements' and 'get_families' available, there's no indication of what makes this tool distinct or when it should be preferred over others, leaving usage unclear.

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