Skip to main content
Glama

Revit MCP

by revit-mcp
get_current_view_info.ts1.05 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { withRevitConnection } from "../utils/ConnectionManager.js"; export function registerGetCurrentViewInfoTool(server: McpServer) { server.tool( "get_current_view_info", "获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。", {}, async (args, extra) => { try { const response = await withRevitConnection(async (revitClient) => { return await revitClient.sendCommand("get_current_view_info", {}); }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `get current view info failed: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } } ); }

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/revit-mcp/revit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server