get_ifc_relationships
Extract and retrieve all relationships associated with a specific IFC entity using its GlobalId. Returns a JSON-formatted string detailing the entity's connections within the model.
Instructions
Get all relationships for a specific IFC entity.
Args:
global_id: GlobalId of the IFC entity
Returns:
A JSON-formatted string with all relationships the entity participates in
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| global_id | Yes |
Implementation Reference
- tools.py:403-424 (handler)The main handler function for the MCP tool 'get_ifc_relationships'. It proxies the request to the Blender addon via socket command, passing the global_id parameter, and returns a formatted JSON response containing the relationships or an error message.@mcp.tool() def get_ifc_relationships(global_id: str) -> str: """ Get all relationships for a specific IFC entity. Args: global_id: GlobalId of the IFC entity Returns: A JSON-formatted string with all relationships the entity participates in """ try: blender = get_blender_connection() result = blender.send_command("get_ifc_relationships", { "global_id": global_id }) # Return the formatted JSON of the results return json.dumps(result, indent=2) except Exception as e: logger.error(f"Error getting IFC relationships: {str(e)}") return f"Error getting IFC relationships: {str(e)}"