Skip to main content
Glama

add_attribute_facet

Add attribute requirements to buildingSMART IDS specifications to define mandatory, optional, or prohibited properties for compliance validation.

Instructions

Add an attribute facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" attribute_name: Attribute name (e.g., "Name", "Description") ctx: FastMCP Context (auto-injected) value: Required value or pattern cardinality: "required", "optional", or "prohibited"

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
attribute_nameYes
valueNo
cardinalityNorequired

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements the logic for adding an attribute facet to an IDS specification. It creates an Attribute object using IfcTester's ids library, appends it to the appropriate section (applicability or requirements), and returns a success status.
    async def add_attribute_facet(
        spec_id: str,
        location: str,
        attribute_name: str,
        ctx: Context,
        value: Optional[str] = None,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add an attribute facet to a specification.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            attribute_name: Attribute name (e.g., "Name", "Description")
            ctx: FastMCP Context (auto-injected)
            value: Required value or pattern
            cardinality: "required", "optional", or "prohibited"
    
        Returns:
            {"status": "added", "facet_type": "attribute", "spec_id": "S1"}
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            await ctx.info(f"Adding attribute facet: {attribute_name} to {spec_id}")
    
            # Create attribute facet using IfcTester
            attr = ids.Attribute(
                name=attribute_name,
                value=value,
                cardinality=cardinality if location == "requirements" else None
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(attr)
            elif location == "requirements":
                spec.requirements.append(attr)
            else:
                raise ToolError(f"Invalid location: {location}")
    
            await ctx.info(f"Attribute facet added: {attribute_name}")
    
            return {
                "status": "added",
                "facet_type": "attribute",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add attribute facet: {str(e)}")
            raise ToolError(f"Failed to add attribute facet: {str(e)}")
  • Registration of the add_attribute_facet tool in the FastMCP server instance.
    mcp_server.tool(facets.add_attribute_facet)
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. While it states this is an 'add' operation (implying mutation), it doesn't disclose important behavioral traits: whether this requires specific permissions, whether it's idempotent, what happens if the facet already exists, or any rate limits. The description mentions the return format but doesn't explain potential error conditions or side effects.

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 (Args, Returns) and uses bullet-like formatting. It's appropriately sized at 8 lines total. Every sentence serves a purpose: the opening statement defines the tool's purpose, the Args section documents parameters, and the Returns section shows output format. There's minimal wasted space.

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 complexity (5 parameters, mutation operation, many siblings) and complete lack of annotations, the description provides basic but incomplete coverage. The presence of an output schema (shown in Returns) helps by documenting the response format, but the description doesn't address key contextual gaps: how this tool relates to siblings, what an 'attribute facet' conceptually is, or behavioral constraints. For a mutation tool with 0% schema documentation, this is minimally adequate.

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?

With 0% schema description coverage, the description provides some parameter context but doesn't fully compensate. It lists all 5 parameters with brief explanations, giving meaning to spec_id, location, attribute_name, value, and cardinality. However, it doesn't explain the significance of 'applicability' vs 'requirements' locations, what constitutes a valid attribute_name, or the implications of different cardinality values. The ctx parameter is noted as auto-injected but not explained.

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 an attribute facet') and the target ('to a specification'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate this tool from its many siblings (like add_classification_facet, add_property_facet, etc.), which would require explaining what makes an 'attribute facet' distinct from other facet types.

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. With 16 sibling tools including various 'add_*_facet' and 'add_*_restriction' tools, there's no indication of when an attribute facet is appropriate versus a classification facet, property facet, or any restriction type. The description also doesn't mention prerequisites or dependencies.

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