Skip to main content
Glama

add_specification

Add a specification to the current IDS document session, defining requirements like name, IFC versions, description, and occurrence rules for building information modeling.

Instructions

Add a specification to the current session's IDS document.

Args: name: Specification name ifc_versions: List of IFC versions (e.g., ["IFC4", "IFC4X3"]) ctx: FastMCP Context (auto-injected) identifier: Optional unique identifier description: Why this information is required instructions: How to fulfill requirements min_occurs: Minimum occurrences (0 = optional) max_occurs: Maximum occurrences (int or "unbounded")

Returns: { "status": "added", "spec_id": "S1", "ifc_versions": ["IFC4"] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
ifc_versionsYes
identifierNo
descriptionNo
instructionsNo
min_occursNo
max_occursNounbounded

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'add_specification' tool. It validates inputs, normalizes IFC versions, creates an ids.Specification object, adds it to the session's IDS document, and returns a status dictionary.
    async def add_specification(
        name: str,
        ifc_versions: List[str],
        ctx: Context,
        identifier: Optional[str] = None,
        description: Optional[str] = None,
        instructions: Optional[str] = None,
        min_occurs: int = 0,
        max_occurs: Union[int, str] = "unbounded"
    ) -> Dict[str, Any]:
        """
        Add a specification to the current session's IDS document.
    
        Args:
            name: Specification name
            ifc_versions: List of IFC versions (e.g., ["IFC4", "IFC4X3"])
            ctx: FastMCP Context (auto-injected)
            identifier: Optional unique identifier
            description: Why this information is required
            instructions: How to fulfill requirements
            min_occurs: Minimum occurrences (0 = optional)
            max_occurs: Maximum occurrences (int or "unbounded")
    
        Returns:
            {
                "status": "added",
                "spec_id": "S1",
                "ifc_versions": ["IFC4"]
            }
        """
        try:
            # Get IDS from session
            ids_obj = await get_or_create_session(ctx)
    
            await ctx.info(f"Adding specification: {name}")
    
            # Validate IFC versions and normalize
            valid_versions = {"IFC2X3", "IFC4", "IFC4X3_ADD2"}
            version_mapping = {
                "IFC4X3": "IFC4X3_ADD2",  # Normalize IFC4X3 to IFC4X3_ADD2
            }
            normalized_versions = []
            for version in ifc_versions:
                version_upper = version.upper()
                # Apply mapping if exists
                version_upper = version_mapping.get(version_upper, version_upper)
                if version_upper not in valid_versions:
                    raise ToolError(
                        f"Invalid IFC version: {version}. Valid versions: {', '.join(valid_versions)}"
                    )
                normalized_versions.append(version_upper)
    
            # Create specification using IfcTester
            spec = ids.Specification(
                name=name,
                ifcVersion=normalized_versions,
                identifier=identifier,
                description=description,
                instructions=instructions,
                minOccurs=min_occurs,
                maxOccurs=max_occurs if isinstance(max_occurs, str) else int(max_occurs)
            )
    
            # Add to IDS
            ids_obj.specifications.append(spec)
    
            spec_id = identifier if identifier else name
    
            await ctx.info(f"Specification added: {spec_id}")
    
            return {
                "status": "added",
                "spec_id": spec_id,
                "ifc_versions": normalized_versions
            }
    
        except ToolError:
            raise
        except Exception as e:
            await ctx.error(f"Failed to add specification: {str(e)}")
            raise ToolError(f"Failed to add specification: {str(e)}")
  • Registers the 'add_specification' tool on the FastMCP server instance using the function imported from the specification module.
    mcp_server.tool(specification.add_specification)
  • Helper function to locate a specification within an IDS object by identifier or name, raising ToolError if not found. (Note: Not directly used in add_specification but part of the module.)
    def _find_specification(ids_obj: ids.Ids, spec_id: str) -> ids.Specification:
        """
        Find specification by identifier or name.
    
        Args:
            ids_obj: IDS object
            spec_id: Specification identifier or name
    
        Returns:
            Specification object
    
        Raises:
            ToolError: If specification not found
        """
        for spec in ids_obj.specifications:
            if getattr(spec, 'identifier', None) == spec_id or spec.name == spec_id:
                return spec
        raise ToolError(f"Specification not found: {spec_id}")
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 this is an 'Add' operation (implying mutation) and shows a return format, but doesn't address important behavioral aspects like: what happens if a specification with the same name already exists, whether this requires specific permissions, if changes are reversible, or any rate limits/constraints. The return example helps but doesn't constitute comprehensive behavioral transparency.

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 front-loads the core functionality. Every sentence adds value, though the parameter documentation is quite detailed (which is necessary given the 0% schema coverage). The structure helps the agent quickly parse the information, though it could be slightly more concise in the parameter explanations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, mutation operation, no annotations) and the existence of an output schema (implied by the return example), the description does a good job of providing necessary context. The parameter documentation is comprehensive, the return format is shown, and the purpose is clear. The main gap is lack of behavioral context and sibling differentiation, but overall it provides substantial guidance for correct tool invocation.

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 provides excellent parameter semantics compensation. It clearly documents all 7 parameters with meaningful explanations beyond just names: clarifying 'ifc_versions' format with examples, explaining optional vs required parameters, defining special values like 'unbounded' for max_occurs, and providing context for what each parameter represents in the domain (e.g., 'Why this information is required' for description).

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 specification') and target resource ('to the current session's IDS document'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its many siblings (like add_attribute_facet, add_bounds_restriction, etc.) which all seem to add different components to IDS documents, leaving the specific role of 'specification' versus other facet/restriction types unclear.

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 the 15 other sibling tools listed, nor does it mention prerequisites, dependencies, or alternative approaches. While it mentions the tool operates on 'the current session's IDS document,' this is more context than usage guidance, leaving the agent with no help in tool selection decisions.

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