Skip to main content
Glama

get_views

Extract and retrieve all views from a Revit model using the MCP server, enabling easy access to view information for analysis or export.

Instructions

获取 Revit 模型中的所有视图

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function in RevitService that executes the core logic for the 'get_views' MCP tool by delegating to the socket client.
    async getViews(): Promise<any[]> { try { return await this.client.getViews(); } catch (error) { console.error('[RevitService] 获取视图失败:', error); throw error; // 不使用模拟数据,直接抛出错误 } }
  • Socket client implementation of getViews that sends the 'get_views' command to the Revit plugin and awaits the response.
    public async getViews(): Promise<any[]> { const response = await this.sendRequest<any[]>('get_views', {}); return response; }
  • Schema definition for the 'get_views' tool provided in the ListTools MCP response, specifying no input parameters.
    name: "get_views", description: "获取 Revit 模型中的所有视图", inputSchema: { type: "object", properties: {} } }, {
  • src/index.ts:205-221 (registration)
    Dynamic registration and dispatch logic in CallToolRequestSchema handler that maps tool name 'get_views' to service.getViews() method.
    const toolName = request.params.name; // 将工具名称转换为 camelCase 方法名 const methodName = toolName.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase()); // 检查 RevitService 是否有对应的方法 if (typeof (this.revitService as any)[methodName] !== 'function') { throw new McpError( ErrorCode.MethodNotFound, `未知工具: ${toolName}` ); } try { // 动态调用对应的方法 const result = await (this.revitService as any)[methodName](request.params.arguments || {}); //const result = '';

Other Tools

Related Tools

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/PiggyAndrew/revit_mcp'

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