get_levels
Retrieve all floor levels from a Revit model to access building elevation data and structural information for design analysis and documentation.
Instructions
获取 Revit 模型中的所有楼层
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_levels"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:160-167 (registration)Registration of the "get_levels" MCP tool in ListToolsRequestSchema, defining its name, description, and empty input schema.
{ name: "get_levels", description: "获取 Revit 模型中的所有楼层", inputSchema: { type: "object", properties: {} } }, { - src/index.ts:163-166 (schema)Input schema for the get_levels tool (no parameters required).
inputSchema: { type: "object", properties: {} } - src/revitService.ts:88-95 (handler)The handler function in RevitService that executes the get_levels tool logic by delegating to RevitSocketClient.getLevels().
async getLevels(): Promise<any[]> { try { return await this.client.getLevels(); } catch (error) { console.error('[RevitService] 获取楼层失败,使用模拟数据:', error); throw error; // 不使用模拟数据,直接抛出错误 } } - src/revitSocketClient.ts:211-214 (helper)Supporting utility in RevitSocketClient that sends the 'get_levels' command to the Revit plugin via socket and returns the levels.
public async getLevels(sortByElevation: boolean = true): Promise<any[]> { const response = await this.sendRequest<any[]>('get_levels', { }); return response; }