Skip to main content
Glama

get_families

Extract all families from a Revit model, optionally filtered by category ID or family name, using the Revit MCP Server for efficient model data retrieval.

Instructions

获取 Revit 模型中的所有族

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdNo族类别 ID(可选)
nameNo族名称过滤(可选)

Implementation Reference

  • Core handler function that executes the tool logic by sending the 'get_families' command to the Revit socket server and returning the response.
    public async getFamilies(): Promise<any[]> { const response = await this.sendRequest<any[]>('get_families', {}); return response; }
  • Intermediate handler in RevitService that delegates to socket client and provides error handling for the get_families tool.
    async getFamilies(): Promise<any[]> { try { return await this.client.getFamilies(); } catch (error) { console.error('[RevitService] 获取族失败:', error); throw error; } }
  • src/index.ts:124-139 (registration)
    Registers the 'get_families' tool in the MCP ListTools response, including description and input schema definition.
    name: "get_families", description: "获取 Revit 模型中的所有族", inputSchema: { type: "object", properties: { categoryId: { type: "string", description: "族类别 ID(可选)" }, name: { type: "string", description: "族名称过滤(可选)" } } } }, {
  • Dynamic tool dispatching logic in MCP CallToolRequestSchema handler that maps 'get_families' to RevitService.getFamilies() and executes it.
    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