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

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": [...] } """

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