Skip to main content
Glama

add_partof_facet

Adds a partOf facet to buildingSMART IDS specifications to define containment relationships between building elements, ensuring compliance with IDS 1.0 standards.

Instructions

Add a partOf facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" relation: Relationship type (e.g., "IFCRELCONTAINEDINSPATIALSTRUCTURE") parent_entity: Parent entity name (e.g., "IFCSPACE") ctx: FastMCP Context (auto-injected) parent_predefined_type: Optional predefined type for parent cardinality: "required", "optional", or "prohibited"

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
relationYes
parent_entityYes
parent_predefined_typeNo
cardinalityNorequired

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic for adding a 'partOf' facet to an IDS specification. It retrieves the session and specification, creates a PartOf facet using the ifctester IDS library, appends it to the appropriate section (applicability or requirements), and returns success status.
    async def add_partof_facet(
        spec_id: str,
        location: str,
        relation: str,
        parent_entity: str,
        ctx: Context,
        parent_predefined_type: Optional[str] = None,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add a partOf facet to a specification.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            relation: Relationship type (e.g., "IFCRELCONTAINEDINSPATIALSTRUCTURE")
            parent_entity: Parent entity name (e.g., "IFCSPACE")
            ctx: FastMCP Context (auto-injected)
            parent_predefined_type: Optional predefined type for parent
            cardinality: "required", "optional", or "prohibited"
    
        Returns:
            {"status": "added", "facet_type": "partof", "spec_id": "S1"}
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            await ctx.info(f"Adding partOf facet: {relation} to {spec_id}")
    
            # Create partOf facet using IfcTester
            # PartOf takes name directly, not an entity object
            part_of = ids.PartOf(
                name=parent_entity.upper(),
                predefinedType=parent_predefined_type,
                relation=relation.upper(),
                cardinality=cardinality if location == "requirements" else None
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(part_of)
            elif location == "requirements":
                spec.requirements.append(part_of)
            else:
                raise ToolError(f"Invalid location: {location}")
    
            await ctx.info(f"PartOf facet added: {relation}")
    
            return {
                "status": "added",
                "facet_type": "partof",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add partOf facet: {str(e)}")
            raise ToolError(f"Failed to add partOf facet: {str(e)}")
  • Registers the 'add_partof_facet' handler as an MCP tool with the FastMCP server instance.
    mcp_server.tool(facets.add_partof_facet)
  • Imports the 'facets' module containing the 'add_partof_facet' implementation.
    from ids_mcp_server.tools import document, specification, facets, validation, restrictions
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action is 'Add' (implying mutation) and shows a return format, but doesn't cover permissions, side effects, error conditions, or system constraints. The description adds minimal behavioral context beyond the basic 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 appropriately sized with a clear purpose statement followed by parameter documentation and return example. Every sentence serves a purpose, though the parameter documentation could be more integrated with the main description rather than in a separate 'Args:' section.

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 6 parameters with 0% schema coverage and no annotations, the description provides basic parameter examples and a return example (output schema exists). However, for a mutation tool with multiple parameters, it lacks sufficient context about the domain, error handling, and integration with sibling tools.

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

Parameters3/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 compensate. It provides examples for 'location', 'relation', 'parent_entity', and 'cardinality', which adds meaning beyond the bare schema. However, it doesn't explain 'spec_id' or 'parent_predefined_type', leaving 2 of 6 parameters without semantic clarification.

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 action ('Add a partOf facet') and target resource ('to a specification'), which is specific and unambiguous. It distinguishes from siblings like 'add_attribute_facet' or 'add_entity_facet' by specifying the facet type. However, it doesn't explicitly contrast with all sibling tools in the list.

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 like other 'add_*_facet' tools or 'add_specification'. It lacks context about prerequisites, typical workflows, or scenarios where this specific facet type is appropriate.

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