Skip to main content
Glama

Revit MCP Server

by ideook
open_document.ts1.07 kB
import { z } from 'zod'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { withRevitConnection } from '../utils/ConnectionManager.js'; export function registerOpenDocumentTool(server: McpServer) { server.tool( 'open_document', 'Open Document', { filePath: z.string().optional().describe('File Path'), }, async (args, extra) => { const params = { filePath: args.filePath, }; try { const response = await withRevitConnection(async (revitClient) => { return await revitClient.sendCommand('open_document', params); }); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `document open 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/ideook/revit-mcp'

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