Skip to main content
Glama

add_material_facet

Add material requirements to building specifications by defining material facets with location and cardinality for IDS compliance.

Instructions

Add a material facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" material_value: Material name, category, or URI ctx: FastMCP Context (auto-injected) cardinality: "required", "optional", or "prohibited"

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
material_valueYes
cardinalityNorequired

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function implementing the core logic of the add_material_facet tool. It adds a material facet to the specified section (applicability or requirements) of an IDS specification using the IfcTester library.
    async def add_material_facet(
        spec_id: str,
        location: str,
        material_value: str,
        ctx: Context,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add a material facet to a specification.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            material_value: Material name, category, or URI
            ctx: FastMCP Context (auto-injected)
            cardinality: "required", "optional", or "prohibited"
    
        Returns:
            {"status": "added", "facet_type": "material", "spec_id": "S1"}
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            await ctx.info(f"Adding material facet: {material_value} to {spec_id}")
    
            # Create material facet using IfcTester
            material = ids.Material(
                value=material_value,
                cardinality=cardinality if location == "requirements" else None
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(material)
            elif location == "requirements":
                spec.requirements.append(material)
            else:
                raise ToolError(f"Invalid location: {location}")
    
            await ctx.info(f"Material facet added: {material_value}")
    
            return {
                "status": "added",
                "facet_type": "material",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add material facet: {str(e)}")
            raise ToolError(f"Failed to add material facet: {str(e)}")
  • Registers the add_material_facet handler function as an MCP tool on the FastMCP server instance.
    mcp_server.tool(facets.add_material_facet)
  • Imports the facets module containing the add_material_facet function, enabling its use in tool registration.
    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. While it states this is an 'add' operation and shows a return format, it doesn't mention whether this operation is idempotent, what happens if the facet already exists, what permissions are required, or any side effects. For a mutation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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, Args, Returns) and uses minimal sentences. The Args section efficiently documents all parameters without redundancy. The only minor improvement would be integrating the purpose statement more seamlessly rather than having it as a separate fragment.

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 has 4 parameters, no annotations, and an output schema (implied by Returns section), the description covers the basic operation and parameters adequately. However, for a mutation tool that modifies specifications, it should ideally mention prerequisites, side effects, or error conditions. The presence of an output schema reduces the need to explain return values, but behavioral context remains light.

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?

With 0% schema description coverage, the description must compensate, and it does so effectively by explaining all 4 parameters in the Args section. It clarifies that 'location' can be 'applicability' or 'requirements', 'material_value' accepts various formats, and 'cardinality' has three specific values. The only missing parameter is 'ctx' which is noted as auto-injected.

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 a material facet') and target resource ('to a specification'), distinguishing it from sibling tools like add_attribute_facet or add_property_facet. It precisely identifies what type of facet is being added, making the purpose unambiguous and differentiated.

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 add_attribute_facet or add_classification_facet. It mentions the 'location' parameter values but doesn't explain the conceptual difference between 'applicability' and 'requirements' contexts or when to choose this tool over other facet-adding siblings.

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