Skip to main content
Glama
ZedMoster

Revit MCP Server

by ZedMoster

create_cable_trays

Create cable trays in Revit by specifying type, dimensions, and coordinates. Automatically converts units and handles batch creation for efficient electrical system modeling.

Instructions

在Revit中创建电缆桥架,支持批量创建,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量创建多个电缆桥架

  • 自动处理单位转换(毫米转英尺)

  • 自动匹配桥架类型

  • 支持指定桥架宽度和高度

  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateCableTrays" params (List[Dict]): 桥架参数列表,每个字典包含: - cableTrayTypeName (str): 桥架类型名称 - startX (float): 起点X坐标(毫米) - startY (float): 起点Y坐标(毫米) - startZ (float): 起点Z坐标(毫米) - endX (float): 终点X坐标(毫米) - endY (float): 终点Y坐标(毫米) - endZ (float): 终点Z坐标(毫米) - width (float): 桥架宽度(毫米) - height (float): 桥架高度(毫米)

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

示例: response = create_cable_trays(ctx, params=[ { "cableTrayTypeName": "梯级式电缆桥架", "startX": 0, "startY": 0, "startZ": 3000, "endX": 5000, "endY": 0, "endZ": 3000, "width": 200, "height": 100 }, { "cableTrayTypeName": "标准", "startX": 5000, "startY": 0, "startZ": 3000, "endX": 5000, "endY": 5000, "endZ": 3000, "width": 200, "height": 100 } ])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoCreateCableTrays
paramsNo

Implementation Reference

  • Tool categorization lists where create_cable_trays is included in MEP_TOOLS for registration.
    ARCHITECTURAL_TOOLS = [
        create_levels, create_floor_plan_views, create_grids, create_walls, create_floors,
        create_door_windows, create_rooms, create_room_tags, create_family_instances, create_sheets
    ]
    
    MEP_TOOLS = [
        create_ducts, create_pipes, create_cable_trays
    ]
    
    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 register_tools function that applies server.tool() decorator to all tools including create_cable_trays from MEP_TOOLS, registering it as an MCP tool.
    def register_tools(server: FastMCP) -> None:
        """注册所有工具到MCP服务器"""
        # 注册建筑工具
        for tool in ARCHITECTURAL_TOOLS:
            server.tool()(tool)
    
        # 注册MEP工具
        for tool in MEP_TOOLS:
            server.tool()(tool)
    
        # 注册通用工具
        for tool in GENERAL_TOOLS:
            server.tool()(tool)
  • Documentation in prompts mentioning the usage of create_cable_trays tool.
    - 使用create_cable_trays()创建电缆桥架
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: batch creation capability, automatic unit conversion (mm to feet), automatic type matching, width/height specification support, and comprehensive error handling. It also describes the JSON-RPC 2.0 protocol usage, though it doesn't mention permissions, side effects, or rate limits.

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 well-structured with clear sections (特性, 参数, 返回, 示例) but contains some redundant information. The JSON-RPC 2.0 specification mention appears twice, and the 'mcp_tool使用时params不要有任何注释信息' note seems out of place. The content is valuable 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?

For a creation tool with no annotations and no output schema, the description provides excellent coverage: clear purpose, detailed parameters, comprehensive return format documentation, and a complete example. The main gap is the lack of usage guidelines compared to sibling tools, but otherwise it's quite complete for a 2-parameter tool.

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 and 2 parameters, the description fully compensates by providing detailed parameter documentation. It explains the 'method' parameter default value and purpose, and thoroughly documents the 'params' array structure including all 9 fields with their data types, units (millimeters), and semantic meaning (start/end coordinates, dimensions).

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 specific action ('创建电缆桥架' - create cable trays) and resource (in Revit), distinguishing it from siblings like create_ducts or create_pipes. The first sentence immediately establishes the tool's purpose with verb+resource specificity.

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 about when to use this tool versus alternatives like create_ducts or create_pipes. The description mentions it's for cable trays but doesn't explain when cable trays are appropriate versus other routing systems, nor does it mention prerequisites or dependencies.

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