Skip to main content
Glama

get_current_document_info

Retrieve essential details of the active view in Revit, such as view type, name, and scale, to streamline project navigation and documentation tasks.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function that executes the tool logic: connects to Revit via withRevitConnection, sends 'get_current_document_info' command, formats and returns the response or error.
    server.tool('get_current_document_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => { console.error('[DEBUG] Tool get_current_document_info called with args:', args); try { console.error('[DEBUG] Establishing connection to Revit'); const response = await withRevitConnection(async (revitClient) => { console.error('[DEBUG] Sending get_current_document_info command to Revit'); return await revitClient.sendCommand('get_current_document_info', {}); }); console.error('[DEBUG] Received response from Revit:', JSON.stringify(response).substring(0, 200) + '...'); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { console.error('[DEBUG] Error in get_current_document_info:', error); return { content: [ { type: 'text', text: `get current document info failed: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } });
  • The exported registration function registerGetCurrentDocumentInfoTool that registers the 'get_current_document_info' tool on the MCP server. This is dynamically called from src/tools/register.ts.
    export function registerGetCurrentDocumentInfoTool(server: McpServer) { console.error('[DEBUG] Registering get_current_document_info tool'); server.tool('get_current_document_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => { console.error('[DEBUG] Tool get_current_document_info called with args:', args); try { console.error('[DEBUG] Establishing connection to Revit'); const response = await withRevitConnection(async (revitClient) => { console.error('[DEBUG] Sending get_current_document_info command to Revit'); return await revitClient.sendCommand('get_current_document_info', {}); }); console.error('[DEBUG] Received response from Revit:', JSON.stringify(response).substring(0, 200) + '...'); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { console.error('[DEBUG] Error in get_current_document_info:', error); return { content: [ { type: 'text', text: `get current document info failed: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }); console.error('[DEBUG] get_current_document_info tool registered successfully'); }

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

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