Skip to main content
Glama

get_ifc_relationships

Retrieve all relationships for an IFC building model entity by providing its GlobalId, returning structured JSON data for analysis.

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
NameRequiredDescriptionDefault
global_idYes

Implementation Reference

  • MCP tool handler implementation for 'get_ifc_relationships'. Forwards the request to the Blender addon via send_command with the global_id parameter, and returns the JSON-formatted result or 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)}"

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/JotaDeRodriguez/Bonsai_mcp'

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