Skip to main content
Glama
ZedMoster

Revit MCP Server

by ZedMoster

find_elements

Locate and retrieve Revit model elements by category, such as walls, doors, or views, returning detailed element information in JSON-RPC 2.0 format.

Instructions

在Revit中按类别查找元素,返回匹配的元素信息列表,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持按类别BuiltInCategory或者Category.Name查找

  • 和视图相关的请使用OST_Views类别作为categoryName参数,获取然后通过参数来过滤出如楼层平面,三维视图,剖面,图纸等

  • 可指定查找实例或类型元素

  • 支持批量多个查询条件

  • 严格遵循JSON-RPC 2.0规范

  • 详细的错误处理和日志记录

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"FindElements" params (List[Dict[str, Union[str, bool]]]): 查询条件列表,每个字典包含: - categoryName (str): BuiltInCategory或者Category.Name (如"OST_Views","OST_Walls","OST_Doors", "视图", "墙", "门"等) - isInstance (bool): True查找实例,False查找类型

返回: dict: JSON-RPC 2.0格式的响应,结构为: 成功时: { "jsonrpc": "2.0", "result": [ { "elementId": "元素ID", "name": "元素名称", "familyName": "族名称" }, ... ], "id": request_id } 失败时: { "jsonrpc": "2.0", "error": { "code": 错误代码, "message": 错误描述, "data": 错误详情 }, "id": request_id }

错误代码: -32600: 无效请求(参数验证失败) -32602: 类别未找到(无效的BuiltInCategory或Category.Name) -32603: 内部错误 -32700: 解析错误(参数格式错误)

示例: > response = find_elements(ctx, params=[ {"categoryName": "OST_Views", "isInstance": True}, {"categoryName": "OST_Doors", "isInstance": False}, {"categoryName": "门", "isInstance": True} ]) > print(response) { "jsonrpc": "2.0", "result": [ {"elementId": "123456", "name": "单扇门", "familyName": "M_单扇门"}, {"elementId": "789012", "name": "双扇门", "familyName": "M_双扇门"} ], "id": 1 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoFindElements
paramsNo

Implementation Reference

  • Registration of the 'find_elements' tool as part of GENERAL_TOOLS list, which is used to register general purpose tools to the FastMCP server.
    GENERAL_TOOLS = [
        get_commands, execute_commands, call_func,
        find_elements, update_elements, delete_elements, parameter_elements, get_locations, move_elements,
        show_elements, active_view, get_selected_elements,
        link_dwg_and_activate_view, get_view_data
    ]
  • The loop that applies the MCP tool decorator to each function in GENERAL_TOOLS, including find_elements, effectively registering the tool.
    # 注册通用工具
    for tool in GENERAL_TOOLS:
        server.tool()(tool)
  • Call to register_tools which registers all tools including find_elements.
    register_tools(mcp)
  • Documentation mentioning usage of find_elements tool in prompts.
    - 使用find_elements()查找特定类别的现有元素
Behavior4/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 does well by describing key behavioral traits: '支持批量多个查询条件' (supports batch multiple query conditions), '严格遵循JSON-RPC 2.0规范' (strictly follows JSON-RPC 2.0 specification), '详细的错误处理和日志记录' (detailed error handling and logging), and the complete error code mapping. It also specifies the return format structure for both success and failure cases. The main gap is it doesn't mention performance characteristics like rate limits or whether this is a read-only operation.

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

Conciseness3/5

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

The description is appropriately structured with clear sections (description, features, parameters, returns, error codes, example). However, it includes some redundant information: '遵循JSON-RPC 2.0规范' appears twice, and the technical note 'mcp_tool使用时params不要有任何注释信息' seems out of place in a user-facing description. The example is detailed but could be more concise. Overall, most content earns its place but could be more efficiently organized.

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?

Given the complexity (2 parameters with 0% schema coverage, no output schema, no annotations), the description does an excellent job of providing context. It covers purpose, parameters with examples, return format, error handling, and includes a practical example. The main gap is the lack of explicit guidance on when to use this versus sibling tools. For a tool with this level of schema/annotation poverty, the description provides substantial compensatory value.

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

Parameters5/5

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

With 0% schema description coverage (schema only shows 'method' and 'params' with no semantic details), the description fully compensates by providing comprehensive parameter information. It explains that 'params' is a list of dictionaries containing 'categoryName' (with examples like 'OST_Views', 'OST_Walls', '门') and 'isInstance' (True for instances, False for types). It also provides context about BuiltInCategory vs Category.Name usage and view-related filtering guidance. The description adds significant value beyond the bare schema.

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 tool's purpose: '在Revit中按类别查找元素,返回匹配的元素信息列表' (find elements by category in Revit and return matching element information list). It specifies the verb '查找' (find) and resource '元素' (elements) with the constraint '按类别' (by category). However, it doesn't explicitly differentiate from sibling tools like 'get_selected_elements' or 'show_elements' that also retrieve element information.

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

Usage Guidelines3/5

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

The description provides some implied usage guidance: '和视图相关的请使用OST_Views类别作为categoryName参数' (for view-related elements, use OST_Views category as categoryName parameter). It also mentions '可指定查找实例或类型元素' (can specify to find instance or type elements). However, it doesn't explicitly state when to use this tool versus alternatives like 'get_selected_elements' or 'show_elements', nor does it provide clear exclusions or prerequisites.

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

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