Skip to main content
Glama

add_entity_facet

Adds an entity facet to IDS specifications to define building elements like walls or doors for compliance with the IDS 1.0 standard.

Instructions

Add an entity facet to a specification.

IMPORTANT: IDS 1.0 allows only ONE entity facet per applicability section. If you need multiple entity types, create separate specifications.

Args: spec_id: Specification identifier location: "applicability" or "requirements" entity_name: IFC entity name (e.g., "IFCWALL") ctx: FastMCP Context (auto-injected) predefined_type: Optional predefined type cardinality: "required", "optional", or "prohibited" (requirements only)

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

Raises: ToolError: If trying to add second entity to applicability section

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
entity_nameYes
predefined_typeNo
cardinalityNorequired

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'add_entity_facet' tool. It adds an entity facet to the specified section (applicability or requirements) of an IDS specification, performs validation, creates the entity using IfcTester's ids.Entity, and handles errors.
    async def add_entity_facet(
        spec_id: str,
        location: str,
        entity_name: str,
        ctx: Context,
        predefined_type: Optional[str] = None,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add an entity facet to a specification.
    
        IMPORTANT: IDS 1.0 allows only ONE entity facet per applicability section.
        If you need multiple entity types, create separate specifications.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            entity_name: IFC entity name (e.g., "IFCWALL")
            ctx: FastMCP Context (auto-injected)
            predefined_type: Optional predefined type
            cardinality: "required", "optional", or "prohibited" (requirements only)
    
        Returns:
            {"status": "added", "facet_type": "entity", "spec_id": "S1"}
    
        Raises:
            ToolError: If trying to add second entity to applicability section
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            # EARLY VALIDATION: Check IDS 1.0 constraint
            validate_single_entity_in_applicability(spec, location)
    
            await ctx.info(f"Adding entity facet: {entity_name} to {spec_id}")
    
            # Create entity facet using IfcTester
            entity = ids.Entity(
                name=entity_name.upper(),
                predefinedType=predefined_type
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(entity)
            elif location == "requirements":
                # Note: Entity facets in requirements don't have cardinality in IDS
                spec.requirements.append(entity)
            else:
                raise ToolError(f"Invalid location: {location}. Must be 'applicability' or 'requirements'")
    
            await ctx.info(f"Entity facet added: {entity_name}")
    
            return {
                "status": "added",
                "facet_type": "entity",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add entity facet: {str(e)}")
            raise ToolError(f"Failed to add entity facet: {str(e)}")
  • Registers the add_entity_facet function as a tool in the FastMCP server.
    mcp_server.tool(facets.add_entity_facet)
  • Imports the facets module which contains the add_entity_facet tool.
    from ids_mcp_server.tools import document, specification, facets, validation, restrictions
  • Imports helper validators used in add_entity_facet, such as validate_single_entity_in_applicability for IDS 1.0 constraints.
    from ids_mcp_server.tools.validators import (
        validate_single_entity_in_applicability,
        validate_property_set_required
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 successfully describes important constraints (the 'only ONE entity facet' rule), error conditions (raises ToolError for second entity in applicability), and the return format. However, it doesn't mention authentication needs, rate limits, or whether this is a read-only vs. write operation.

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 constraint, args, returns, raises) and front-loads the most critical information. Every sentence earns its place, though the formatting could be slightly more compact. The information density is high with minimal waste.

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 (mutation tool with constraints), 0% schema coverage, and the presence of an output schema, the description provides excellent completeness. It explains the tool's purpose, usage constraints, all parameters, return values, and error conditions. The output schema handles return format details, so the description appropriately focuses on operational context.

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?

With 0% schema description coverage, the description fully compensates by explaining all 5 parameters in detail: spec_id, location (with allowed values), entity_name (with example), predefined_type (optional), and cardinality (with allowed values and context restriction). It adds crucial meaning beyond the bare schema, including constraints like 'requirements only' for cardinality.

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 specific action ('Add an entity facet') and the target resource ('to a specification'), distinguishing it from sibling tools like add_attribute_facet or add_material_facet. It provides concrete details about what an entity facet is (IFC entity name) and its purpose within IDS specifications.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs alternatives: it states 'If you need multiple entity types, create separate specifications' and warns about the 'only ONE entity facet per applicability section' constraint. It also clarifies that cardinality is 'requirements only', helping the agent understand context-specific usage.

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