get_ifc_project_info
Extract key project details from IFC models, including project name, description, and entity type counts, using this tool in Bonsai-mcp to analyze building data efficiently.
Instructions
Get basic information about the IFC project, including name, description,
and counts of different entity types.
Returns:
A JSON-formatted string with project information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools.py:263-279 (handler)MCP tool handler for 'get_ifc_project_info'. Connects to Blender addon via persistent socket connection, sends the 'get_ifc_project_info' command, and returns the result as formatted JSON string. Handles errors by logging and returning error message.def get_ifc_project_info() -> str: """ Get basic information about the IFC project, including name, description, and counts of different entity types. Returns: A JSON-formatted string with project information """ try: blender = get_blender_connection() result = blender.send_command("get_ifc_project_info") # Return the formatted JSON of the results return json.dumps(result, indent=2) except Exception as e: logger.error(f"Error getting IFC project info: {str(e)}") return f"Error getting IFC project info: {str(e)}"
- tools.py:216-217 (helper)Uses 'get_ifc_project_info' command as a simple ping to check if the existing Blender socket connection is still alive during get_blender_connection() function._blender_connection.send_command("get_ifc_project_info") return _blender_connection
- tools.py:263-263 (registration)The @mcp.tool() decorator registers the get_ifc_project_info function as an MCP tool.def get_ifc_project_info() -> str: