Skip to main content
Glama

load_ids

Load an IDS file or XML string into the current session to manage buildingSMART Information Delivery Specifications, replacing any existing IDS data.

Instructions

Load an existing IDS file into the current session.

Replaces any existing IDS in this session.

Args: source: File path or XML string ctx: FastMCP Context (auto-injected) source_type: "file" or "string"

Returns: { "status": "loaded", "title": "...", "specification_count": 3, "specifications": [...] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
source_typeNofile

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function implementing the load_ids tool logic. Loads IDS from file or string, processes it into session, and returns summary info.
    async def load_ids(
        source: str,
        ctx: Context,
        source_type: str = "file"
    ) -> Dict[str, Any]:
        """
        Load an existing IDS file into the current session.
    
        Replaces any existing IDS in this session.
    
        Args:
            source: File path or XML string
            ctx: FastMCP Context (auto-injected)
            source_type: "file" or "string"
    
        Returns:
            {
                "status": "loaded",
                "title": "...",
                "specification_count": 3,
                "specifications": [...]
            }
        """
        try:
            if source_type == "file":
                ids_obj = await create_session_from_file(ctx, source)
            elif source_type == "string":
                ids_obj = await create_session_from_string(ctx, source)
            else:
                raise ToolError(f"Invalid source_type: {source_type}. Must be 'file' or 'string'")
    
            # Build specification summary
            spec_list = []
            for spec in ids_obj.specifications:
                spec_list.append({
                    "name": spec.name,
                    "identifier": getattr(spec, 'identifier', None),
                    "ifc_versions": spec.ifcVersion if hasattr(spec, 'ifcVersion') else []
                })
    
            return {
                "status": "loaded",
                "title": ids_obj.info.get("title", "Untitled"),
                "author": ids_obj.info.get("author"),
                "specification_count": len(ids_obj.specifications),
                "specifications": spec_list
            }
    
        except FileNotFoundError as e:
            await ctx.error(f"File not found: {str(e)}")
            raise ToolError(f"File not found: {str(e)}")
        except Exception as e:
            await ctx.error(f"Failed to load IDS: {str(e)}")
            raise ToolError(f"Failed to load IDS: {str(e)}")
  • Registers the load_ids tool function with the FastMCP server instance.
    mcp_server.tool(document.load_ids)
  • Type hints and docstring define the input schema (source: str, source_type: str='file') and output structure for the tool.
    async def load_ids(
        source: str,
        ctx: Context,
        source_type: str = "file"
    ) -> Dict[str, Any]:
        """
        Load an existing IDS file into the current session.
    
        Replaces any existing IDS in this session.
    
        Args:
            source: File path or XML string
            ctx: FastMCP Context (auto-injected)
            source_type: "file" or "string"
    
        Returns:
            {
                "status": "loaded",
                "title": "...",
                "specification_count": 3,
                "specifications": [...]
            }
        """
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it 'Replaces any existing IDS in this session' (destructive effect), specifies the return structure, and mentions auto-injection of 'ctx'. It does not cover rate limits or auth needs, but provides sufficient operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by behavioral note, parameter details, and return values in a structured format. Every sentence adds value with no redundancy, making it efficient and easy to parse.

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

Completeness5/5

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

Given the tool's complexity (loading files with session state impact), no annotations, and an output schema that documents return values, the description is complete. It covers purpose, behavior, parameters, and output, leaving no gaps for the agent to operate correctly.

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?

Schema description coverage is 0%, so the description must compensate fully. It effectively explains both parameters: 'source' as 'File path or XML string' and 'source_type' as '"file" or "string"', adding crucial meaning beyond the bare schema. This covers all parameters comprehensively.

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 verb 'Load' and resource 'IDS file' into 'current session', distinguishing it from sibling tools like 'create_ids', 'export_ids', or 'get_ids_info'. It specifies the action is about loading existing files rather than creating new ones or exporting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: to load an IDS file into a session. It implicitly distinguishes from alternatives like 'create_ids' for new files or 'validate_ids' for checking, but does not explicitly state when not to use it or name specific alternatives.

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