Skip to main content
Glama

add_classification_facet

Add classification facets to IDS specifications to categorize requirements by systems like Uniclass or OmniClass for standardized compliance.

Instructions

Add a classification facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" classification_value: Classification code or pattern ctx: FastMCP Context (auto-injected) classification_system: Classification system name or URI cardinality: "required", "optional", or "prohibited"

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
locationYes
classification_valueYes
classification_systemNo
cardinalityNorequired

Implementation Reference

  • The handler function that implements the add_classification_facet tool, creating and appending a Classification facet to the specified IDS specification section using IfcTester library.
    async def add_classification_facet(
        spec_id: str,
        location: str,
        classification_value: str,
        ctx: Context,
        classification_system: Optional[str] = None,
        cardinality: str = "required"
    ) -> Dict[str, Any]:
        """
        Add a classification facet to a specification.
    
        Args:
            spec_id: Specification identifier
            location: "applicability" or "requirements"
            classification_value: Classification code or pattern
            ctx: FastMCP Context (auto-injected)
            classification_system: Classification system name or URI
            cardinality: "required", "optional", or "prohibited"
    
        Returns:
            {"status": "added", "facet_type": "classification", "spec_id": "S1"}
        """
        try:
            ids_obj = await get_or_create_session(ctx)
            spec = _find_specification(ids_obj, spec_id)
    
            await ctx.info(f"Adding classification facet: {classification_value} to {spec_id}")
    
            # Create classification facet using IfcTester
            classification = ids.Classification(
                value=classification_value,
                system=classification_system,
                cardinality=cardinality if location == "requirements" else None
            )
    
            # Add to appropriate section
            if location == "applicability":
                spec.applicability.append(classification)
            elif location == "requirements":
                spec.requirements.append(classification)
            else:
                raise ToolError(f"Invalid location: {location}")
    
            await ctx.info(f"Classification facet added: {classification_value}")
    
            return {
                "status": "added",
                "facet_type": "classification",
                "spec_id": spec_id
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add classification facet: {str(e)}")
            raise ToolError(f"Failed to add classification facet: {str(e)}")
  • Registers the add_classification_facet tool with the FastMCP server instance.
    mcp_server.tool(facets.add_classification_facet)
  • Imports the facets module containing the add_classification_facet tool.
    from ids_mcp_server.tools import document, specification, facets, validation, restrictions

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