Skip to main content
Glama
ZedMoster

Revit MCP Server

by ZedMoster

call_func

Execute Revit functions by specifying names and parameters in JSON-RPC format, enabling automation of building model operations through batch processing with parameter validation.

Instructions

调用 Revit 函数服务,支持直接传递功能名称及其参数,遵循 JSON-RPC 2.0 规范。

特性:

  • 支持批量调用多个功能

  • 支持传递参数给每个功能

  • 自动验证参数有效性

  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CallFunc" params (List[Dict]): 功能参数列表,必须提供至少一个函数名,每个字典包含: - name (str): 要调用的功能名称 - params (dict, optional): 功能对应的参数,可为空

返回: dict: JSON-RPC 2.0格式的响应

示例: # 调用不需要参数的函数 response = call_func(ctx, params=[ {"name": "ClearDuplicates"}, {"name": "DimensionViewPlanGrids"}, {"name": "DeleteZeroRooms"} ])

# 调用带参数的函数
response = call_func(ctx, params=[
    {"name": "新增标高", "params": {"offset": 3000}}
])

# 混合调用
response = call_func(ctx, params=[
    {"name": "ClearDuplicates"},
    {"name": "新增标高", "params": {"offset": 3000}}
])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoCallFunc
paramsNo

Implementation Reference

  • call_func is included in the GENERAL_TOOLS list, indicating it is one of the general tools to be registered as an MCP tool.
    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 registers all tools from GENERAL_TOOLS (including call_func) to the MCP server using the server.tool() decorator.
    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)
  • Prompt template mentions using call_func() to call specific functions not predefined.
    - 对于未预定义的功能,使用call_func()调用特定功能
  • Test file demonstrates calling the underlying Revit RPC method 'CallFunc', likely what the MCP tool proxies.
        "method": "CallFunc",
        "params": data,
    }
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. It effectively discloses key behavioral traits: supports batch calls, parameter passing, automatic parameter validation, and comprehensive error handling. It also specifies the JSON-RPC 2.0 protocol. However, it doesn't mention potential side effects, performance characteristics, or authentication requirements that might be relevant for a Revit API tool.

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

Conciseness4/5

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

The description is well-structured with clear sections (description, features, parameters, returns, examples). It's appropriately sized for a tool with 2 parameters and complex functionality. The content is front-loaded with the core purpose. Some minor redundancy exists between the features list and parameter explanations.

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 tool's complexity (generic function calling with JSON-RPC), no annotations, 0% schema coverage, and no output schema, the description provides substantial context. It covers purpose, features, parameters, return format, and includes multiple examples. The main gap is lack of output schema details, but the description specifies the return is 'JSON-RPC 2.0格式的响应' which provides some guidance.

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 has no descriptions), the description fully compensates by providing detailed parameter semantics. It explains both parameters: 'method' as the JSON-RPC method name with default 'CallFunc', and 'params' as a list of dictionaries containing function names and optional parameters. The structure of the params dictionary is clearly documented with 'name' and 'params' fields.

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 函数服务,支持直接传递功能名称及其参数,遵循 JSON-RPC 2.0 规范' (Call Revit function service, supports directly passing function names and their parameters, follows JSON-RPC 2.0 specification). This specifies the verb (call), resource (Revit functions), and protocol (JSON-RPC 2.0). However, it doesn't explicitly differentiate from sibling tools like 'execute_commands' or 'get_commands' which might have overlapping functionality.

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 the '特性' (Features) section and examples, showing it's for batch calling functions with parameters. However, it lacks explicit guidance on when to use this tool versus alternatives like 'execute_commands' or other specific creation tools. The examples help but don't establish clear boundaries.

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