Skip to main content
Glama
ZedMoster

Revit MCP Server

by ZedMoster

execute_commands

Execute commands to add or remove Revit functionality panels in batch, with automatic matching and error handling for building model automation.

Instructions

执行指定的功能命令,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量执行多个功能命令

  • 可以指定是添加还是移除功能面板

  • 自动查找并执行匹配名称的功能

  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"ExecuteCommands" params (List[Dict]): 命令参数列表,每个字典包含: - name (str): 要执行的功能名称 - add (bool): True表示添加功能面板,False表示移除功能面板

返回: dict: JSON-RPC 2.0格式的响应,结构为: 成功时: { "jsonrpc": "2.0", "result": [ { "name": "AI助手", "description": "使用DeepSeek直接操作Revit,会员用户抢先体验", "tooltip": "关注公众号获取最新功能消息(F1获取帮助)" }, { "name": "AI代码转换", "description": "AI生成的代码功能尝试转换为Revit可用功能,会员用户抢先体验~", "tooltip": "关注公众号获取最新功能消息(F1获取帮助)" }, ... ], "id": request_id } 失败时: { "jsonrpc": "2.0", "error": { "code": int, "message": str, "data": any }, "id": request_id }

示例: # 添加功能面板 response = execute_command(ctx, params=[ {"name": "AI助手", "add": True}, {"name": "AI代码转换", "add": True} ])

# 移除功能面板
response = execute_command(ctx, params=[
    {"name": "AI助手", "add": False}
])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoExecuteCommands
paramsNo

Implementation Reference

  • The 'execute_commands' tool is listed in GENERAL_TOOLS array, which is registered to the MCP server using server.tool() in the register_tools function called at line 248.
    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
    ]
  • Registration loop for general tools including execute_commands using FastMCP's tool decorator.
    # 注册通用工具
    for tool in GENERAL_TOOLS:
        server.tool()(tool)
  • Test file demonstrating usage of ExecuteCommands RPC method sent to Revit plugin, likely corresponding to the MCP tool execution.
    # -*- coding: utf-8 -*-
    
    from _tcp import send_tcp_data
    
    # 构造 JSON-RPC 请求
    json_rpc_request = {
        "jsonrpc": "2.0",
        "method": "ExecuteCommands",
        "params":
            [
                {"name": "F1关闭启用", "add": True},
                {"name": "F1关闭启用", "add": False}
            ]
        ,
    }
    
    # 发送更新元素数据
    send_tcp_data(json_rpc_request)
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 execution capability, add/remove functionality, automatic name matching, and error handling mechanisms. It also mentions JSON-RPC 2.0 compliance which informs the response format. The description doesn't contradict any annotations since none exist.

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 initial note about 'mcp_tool使用时params不要有任何注释信息' seems like implementation detail that doesn't help tool selection. The response format documentation is quite detailed but necessary given no output schema.

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 tool with no annotations, no output schema, and 0% schema description coverage, the description provides substantial context. It covers purpose, parameters with semantics, behavioral traits, and complete response format documentation. The main gap is lack of explicit differentiation from sibling tools like 'call_func'.

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 provides excellent parameter semantics. It explains the 'method' parameter default value and purpose, and thoroughly documents the 'params' array structure including nested 'name' and 'add' fields with their meanings. This fully compensates for the schema's lack of descriptions.

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 '执行指定的功能命令' (executes specified function commands) and mentions JSON-RPC 2.0 compliance. It distinguishes from siblings by focusing on command execution rather than element creation/deletion or data retrieval. However, it doesn't explicitly differentiate from 'call_func' which might be a similar sibling tool.

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 implied usage through examples showing how to add/remove function panels, and mentions '支持批量执行多个功能命令' (supports batch execution of multiple function commands). However, it lacks explicit guidance on when to use this tool versus alternatives like 'call_func' or other command-related tools, and doesn't mention prerequisites or constraints.

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