Revit MCP Server

by ZedMoster
Verified

parameter_elements

Retrieve detailed parameter information for Revit elements in bulk or for specific parameters using the JSON-RPC 2.0 protocol. Supports error handling and returns parameter hash codes, names, and values.

Instructions

获取Revit元素的参数信息,支持批量查询和特定参数查询,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量查询多个元素的参数
  • 可查询特定参数或元素所有参数
  • 返回参数哈希码、名称和值的完整信息
  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"ParameterElements" params (List[Dict]): 查询参数列表,每个字典包含: - elementId (Union[int, str]): 要查询的元素ID - parameterName (str, optional): 要查询的特定参数名称

返回: dict: JSON-RPC 2.0格式的响应,结构为: 成功时: { "jsonrpc": "2.0", "result": { "elementId1": [ { "hashCode": int, "parameterName": str, "parameterValue": str, } ], ... }, "id": request_id } 失败时: { "jsonrpc": "2.0", "error": { "code": int, "message": str, "data": any }, "id": request_id }

示例: # 查询多个元素的参数 response = parameter_elements(ctx, params=[ {"elementId": 212792, "parameterName": "注释"}, # 获取特定参数 {"elementId": 212781} # 获取所有参数 ])

# 输出示例 { "jsonrpc": "2.0", "result": { "212792": [ { "hashCode": 12345, "parameterName": "注释", "parameterValue": "示例注释", } ], "212781": [ { "hashCode": 23456, "parameterName": "长度", "parameterValue": "5000", }, ... ] }, "id": 1 }

Input Schema

NameRequiredDescriptionDefault
methodNoParameterElements
paramsNo

Input Schema (JSON Schema)

{ "properties": { "method": { "default": "ParameterElements", "title": "Method", "type": "string" }, "params": { "default": null, "items": { "additionalProperties": true, "type": "object" }, "title": "Params", "type": "array" } }, "title": "parameter_elementsArguments", "type": "object" }
ID: 4dgua6bhbf