Skip to main content
Glama

export_ifc_data

Extract and export IFC building model data to JSON or CSV files, with filtering options for entity types and building levels.

Instructions

Export IFC data to a file in JSON or CSV format.

This tool extracts IFC data and creates a structured export file. You can filter
by entity type and/or building level, and choose the output format.

Args:
    entity_type: Type of IFC entity to export (e.g., "IfcWall") - leave empty for all entities
    level_name: Name of the building level to filter by (e.g., "Level 1") - leave empty for all levels
    output_format: "json" or "csv" format for the output file
    
Returns:
    Confirmation message with the export file path or an error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeNo
level_nameNo
output_formatNocsv
ctxNo

Implementation Reference

  • The MCP tool handler for 'export_ifc_data'. This function proxies the request to the Blender addon via socket command, validates parameters, handles errors, and returns results as JSON.
    @mcp.tool()
    def export_ifc_data(
        entity_type: str | None = None, 
        level_name: str | None = None, 
        output_format: str = "csv",
        ctx: Context | None = None
    ) -> str:
        """
        Export IFC data to a file in JSON or CSV format.
        
        This tool extracts IFC data and creates a structured export file. You can filter
        by entity type and/or building level, and choose the output format.
        
        Args:
            entity_type: Type of IFC entity to export (e.g., "IfcWall") - leave empty for all entities
            level_name: Name of the building level to filter by (e.g., "Level 1") - leave empty for all levels
            output_format: "json" or "csv" format for the output file
            
        Returns:
            Confirmation message with the export file path or an error message
        """
        try:
            # Get Blender connection
            blender = get_blender_connection()
    
            # Validate output format
            if output_format not in ["json", "csv"]:
                return "Error: output_format must be 'json' or 'csv'"
    
            # Execute the export code in Blender
            result = blender.send_command("export_ifc_data", {
                "entity_type": entity_type,
                "level_name": level_name,
                "output_format": output_format
            })
            
            # Check for errors from Blender
            if isinstance(result, dict) and "error" in result:
                return f"Error: {result['error']}"
            
            # Return the result with export summary
            # return result
            return json.dumps(result, indent=2)
        
        except Exception as e:
            logger.error(f"Error exporting IFC data: {str(e)}")
            return f"Error exporting IFC data: {str(e)}"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'extracts IFC data and creates a structured export file' and returns a confirmation or error message, but lacks critical details: whether this is a read-only operation, if it modifies source data, what permissions are required, file size limits, or performance characteristics. For a data export tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear opening sentence, followed by elaboration, and then a formatted parameter section. It's appropriately sized at 7 sentences. The only minor inefficiency is repeating 'leave empty for all' twice instead of consolidating, but overall it's efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose and parameters but lacks behavioral context, error handling details, and output specifics beyond a vague 'confirmation message.' For a data export tool, more information about file location, format specifics, or limitations would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant value beyond the input schema, which has 0% description coverage. It explains all three user-facing parameters (entity_type, level_name, output_format) with examples and clarifies that empty values mean 'all entities' or 'all levels.' The 'ctx' parameter isn't mentioned, but this is acceptable as it appears to be a system parameter. The description compensates well for the schema's lack of documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Export IFC data to a file in JSON or CSV format.' It specifies the verb ('export'), resource ('IFC data'), and output formats. However, it doesn't explicitly differentiate from sibling tools like 'export_bc3_budget' or 'export_drawing_png', which also export data but in different formats or contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions filtering capabilities but doesn't compare to siblings like 'list_ifc_entities' or 'get_ifc_properties' that might retrieve similar data without exporting. There's no mention of prerequisites, dependencies, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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