Skip to main content
Glama

get_current_view_info

Retrieve detailed information about the active view in Revit, including view type, name, scale, and other essential attributes, enabling efficient workflow automation and data access.

Instructions

获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'get_current_view_info' tool. It connects to Revit via withRevitConnection, sends the 'get_current_view_info' command, formats the response as JSON text, and handles errors.
    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) }`, }, ], }; } }
  • Registers the 'get_current_view_info' tool on the MCP server, specifying the tool name, Chinese description, empty input schema {}, and references the handler function. This function is dynamically loaded and called from src/tools/register.ts.
    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) }`, }, ], }; } } );

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

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