Skip to main content
Glama

add_property_facet

Add property requirements to building specifications by defining property sets, names, values, and cardinality for IDS compliance.

Instructions

Add a property facet to a specification.

IMPORTANT: The property_set parameter is REQUIRED for valid IDS export.

Args: spec_id: Specification identifier location: "applicability" or "requirements" property_name: Property name (e.g., "FireRating") ctx: FastMCP Context (auto-injected) property_set: Property set name (e.g., "Pset_WallCommon") - REQUIRED data_type: IFC data type (e.g., "IFCLABEL") value: Required value or pattern cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "property", "spec_id": "S1"}

Raises: ToolError: If property_set is None or empty

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
property_nameYes
property_setNo
data_typeNo
valueNo
cardinalityNorequired

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the add_property_facet tool. It validates inputs, creates an ids.Property facet using IfcTester, adds it to the specification's applicability or requirements section, and returns success status.
    async def add_property_facet(
        spec_id: str,
        location: str,
        property_name: str,
        ctx: Context,
        property_set: Optional[str] = None,
        data_type: Optional[str] = None,
        value: Optional[str] = None,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add a property facet to a specification.
    
        IMPORTANT: The property_set parameter is REQUIRED for valid IDS export.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            property_name: Property name (e.g., "FireRating")
            ctx: FastMCP Context (auto-injected)
            property_set: Property set name (e.g., "Pset_WallCommon") - REQUIRED
            data_type: IFC data type (e.g., "IFCLABEL")
            value: Required value or pattern
            cardinality: "required", "optional", or "prohibited"
    
        Returns:
            {"status": "added", "facet_type": "property", "spec_id": "S1"}
    
        Raises:
            ToolError: If property_set is None or empty
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            # EARLY VALIDATION: Check property_set required
            validate_property_set_required(property_set, property_name)
    
            await ctx.info(f"Adding property facet: {property_name} to {spec_id}")
    
            # Create property facet using IfcTester
            prop = ids.Property(
                baseName=property_name,
                propertySet=property_set,
                dataType=data_type.upper() if data_type else None,
                value=value,
                cardinality=cardinality if location == "requirements" else None
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(prop)
            elif location == "requirements":
                spec.requirements.append(prop)
            else:
                raise ToolError(f"Invalid location: {location}")
    
            await ctx.info(f"Property facet added: {property_name}")
    
            return {
                "status": "added",
                "facet_type": "property",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add property facet: {str(e)}")
            raise ToolError(f"Failed to add property facet: {str(e)}")
  • Registers the add_property_facet tool function with the FastMCP server instance.
    mcp_server.tool(facets.add_property_facet)
  • Helper function called by the handler to validate that the property_set parameter is provided, enforcing IfcTester export requirements.
    def validate_property_set_required(
        property_set: Optional[str],
        property_name: str
    ) -> None:
        """
        Validate that property_set is provided for property facets.
    
        IfcTester requirement: property_set must be specified for valid XML export.
        While the IDS schema technically allows property_set to be optional,
        IfcTester's XML generation requires it for successful validation.
    
        Args:
            property_set: Property set name (can be None)
            property_name: Property name (for error message)
    
        Raises:
            ToolError: If property_set is None or empty
    
        Example:
            >>> validate_property_set_required("Pset_WallCommon", "FireRating")
            >>> # Succeeds
            >>> validate_property_set_required(None, "FireRating")
            >>> # Raises ToolError
        """
        if not property_set or property_set.strip() == "":
            raise ToolError(
                f"Property facet validation error: 'property_set' parameter is required.\n\n"
                f"Property '{property_name}' must belong to a property set for valid IDS export.\n\n"
                "COMMON PROPERTY SETS:\n"
                "  - Pset_WallCommon (for walls)\n"
                "  - Pset_DoorCommon (for doors)\n"
                "  - Pset_WindowCommon (for windows)\n"
                "  - Pset_SpaceCommon (for spaces)\n"
                "  - Pset_SlabCommon (for slabs)\n"
                "  - Pset_BeamCommon (for beams)\n"
                "  - Pset_ColumnCommon (for columns)\n\n"
                "CUSTOM PROPERTY SETS:\n"
                "  - Pset_Common (generic custom properties)\n"
                "  - Pset_CustomProperties (organization-specific)\n\n"
                "This requirement ensures valid XML export via IfcTester.\n"
                "See CLAUDE.md for more details on this IfcTester requirement."
            )
Behavior4/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 effectively describes key behaviors: it's a mutation tool (implied by 'Add'), specifies that 'property_set' is required for valid export, documents the return format, and mentions error conditions ('Raises: ToolError'). It doesn't cover all potential behaviors like rate limits or auth needs, but provides substantial context beyond basic parameters.

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 clear sections (purpose, important note, args, returns, raises) and front-loaded key information. Every sentence earns its place by providing essential details. It could be slightly more concise by integrating the 'IMPORTANT' note into the main description, but overall it's efficiently organized without wasted words.

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

Completeness5/5

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

Given the complexity (7 parameters, mutation operation, no annotations) and the presence of an output schema (implied by the 'Returns' section), the description is complete enough. It covers purpose, critical requirements, all parameter meanings, return values, and error conditions. The output schema existence means the description doesn't need to explain return values in detail, and it provides all necessary context for effective tool use.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It does so excellently by explaining all 7 parameters with clear semantics: 'spec_id' as specification identifier, 'location' with allowed values, 'property_name' with examples, 'property_set' as required for export with examples, 'data_type' as IFC type, 'value' as required value/pattern, and 'cardinality' with allowed values. This adds significant meaning beyond the bare schema.

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

Purpose5/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 with a specific verb ('Add') and resource ('property facet to a specification'). It distinguishes itself from siblings like 'add_attribute_facet' or 'add_material_facet' by specifying it's for property facets, not other types. The description explicitly mentions what it does rather than just restating the name.

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

Usage Guidelines3/5

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

The description provides some implied usage guidance by noting that 'property_set parameter is REQUIRED for valid IDS export,' which suggests when this tool is necessary for compliance. However, it doesn't explicitly state when to use this tool versus alternatives like 'add_attribute_facet' or other sibling tools, nor does it provide exclusions or prerequisites beyond the required parameter.

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/vinnividivicci/ifc-ids-mcp'

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