Skip to main content
Glama

magg_load_kit

Load a kit and its servers into the configuration of the MAGG MCP server, enabling dynamic extension of LLM capabilities through server management and configuration.

Instructions

Load a kit and its servers into the configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesKit name to load (filename without .json)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNo
outputNo

Implementation Reference

  • The primary handler function for the 'magg_load_kit' MCP tool. Accepts a kit name, loads the kit configuration using KitManager, saves the config, and mounts any new enabled servers.
    async def load_kit(
            self,
            name: Annotated[str, Field(description="Kit name to load (filename without .json)")],
    ) -> MaggResponse:
        """Load a kit and its servers into the configuration."""
        try:
            config = self.config
            success, message = self.kit_manager.load_kit_to_config(name, config)
    
            if success:
                if not self.save_config(config):
                    return MaggResponse.error("Failed to save configuration")
    
                for server_name, server in config.servers.items():
                    if server.enabled and server_name not in self.server_manager.mounted_servers:
                        await self.server_manager.mount_server(server)
    
                return MaggResponse.success({
                    "action": "kit_loaded",
                    "kit": name,
                    "message": message
                })
            else:
                return MaggResponse.error(message)
    
        except Exception as e:
            return MaggResponse.error(f"Failed to load kit: {str(e)}")
  • Registers the 'magg_load_kit' tool (and other kit tools) by including self.load_kit in the tools list and applying the MCP tool decorator via self.mcp.tool.
    def _register_tools(self):
        """Register all Magg management tools programmatically.
        """
        self_prefix_ = self.self_prefix_
    
        tools = [
            (self.add_server, f"{self_prefix_}add_server", None),
            (self.remove_server, f"{self_prefix_}remove_server", None),
            (self.list_servers, f"{self_prefix_}list_servers", None),
            (self.enable_server, f"{self_prefix_}enable_server", None),
            (self.disable_server, f"{self_prefix_}disable_server", None),
            (self.search_servers, f"{self_prefix_}search_servers", None),
            (self.smart_configure, f"{self_prefix_}smart_configure", None),
            (self.analyze_servers, f"{self_prefix_}analyze_servers", None),
            (self.status, f"{self_prefix_}status", None),
            (self.check, f"{self_prefix_}check", None),
            (self.reload_config_tool, f"{self_prefix_}reload_config", None),
            (self.load_kit, f"{self_prefix_}load_kit", None),
            (self.unload_kit, f"{self_prefix_}unload_kit", None),
            (self.list_kits, f"{self_prefix_}list_kits", None),
            (self.kit_info, f"{self_prefix_}kit_info", None),
        ]
    
        def call_tool_wrapper(func):
            @wraps(func)
            async def wrapper(*args, **kwds):
                result = await func(*args, **kwds)
    
                if isinstance(result, MaggResponse):
                    return result.as_json_text_content
    
                return result
    
            return wrapper
    
        for method, tool_name, options in tools:
            self.mcp.tool(name=tool_name, **(options or {}))(call_tool_wrapper(method))
    
        self._register_resources()
        self._register_prompts()
  • KitManager helper method called by the tool handler to perform the actual kit loading into the config, adding/updating servers, and tracking kits.
    def load_kit_to_config(self, kit_name: str, config: 'MaggConfig') -> tuple[bool, str]:
        """Load a kit and its servers into the configuration.
    
        Returns:
            Tuple of (success, message)
        """
        if kit_name in config.kits:
            return False, f"Kit '{kit_name}' is already loaded"
    
        available_kits = self.discover_kits()
        if kit_name not in available_kits:
            return False, f"Kit '{kit_name}' not found in any kit.d directory"
    
        kit_path = available_kits[kit_name]
        kit_config = self.load_kit(kit_path)
        if not kit_config:
            return False, f"Failed to load kit '{kit_name}' from {kit_path}"
    
        self.add_kit(kit_name, kit_config)
    
        servers_added = []
        servers_updated = []
    
        for server_name, server_config in kit_config.servers.items():
            if server_name in config.servers:
                if kit_name not in config.servers[server_name].kits:
                    config.servers[server_name].kits.append(kit_name)
                    servers_updated.append(server_name)
            else:
                server_config.kits = [kit_name]
                config.servers[server_name] = server_config
                servers_added.append(server_name)
    
        config.kits[kit_name] = KitInfo(
            name=kit_name,
            description=kit_config.description,
            path=str(kit_path),
            source="file"
        )
    
        msg_parts = [f"Kit '{kit_name}' loaded successfully"]
        if servers_added:
            msg_parts.append(f"Added servers: {', '.join(servers_added)}")
        if servers_updated:
            msg_parts.append(f"Updated servers: {', '.join(servers_updated)}")
        return True, ". ".join(msg_parts)
  • Input schema defined via Pydantic Annotated Field in the handler function signature.
            name: Annotated[str, Field(description="Kit name to load (filename without .json)")],
    ) -> MaggResponse:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Load') but doesn't describe key traits: whether this is a read-only or mutating operation (likely mutating based on 'load'), what 'load' entails (e.g., adding to runtime, overwriting existing config), potential side effects (e.g., affecting server states), or error conditions (e.g., if kit doesn't exist). This leaves significant gaps for a tool that likely modifies configuration.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple tool, with every part contributing essential information.

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 an output schema (which handles return values), no annotations, and a simple input schema with full coverage, the description is minimally adequate. However, for a tool that likely performs configuration changes, it lacks details on behavioral aspects like mutability, side effects, or error handling, which are important for safe usage despite the output schema covering response format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'name' parameter fully documented as 'Kit name to load (filename without .json)'. The description adds no additional parameter semantics beyond this, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles the heavy lifting.

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 ('Load') and the target ('a kit and its servers into the configuration'), which is specific and distinguishes it from siblings like 'magg_unload_kit' (unloading) and 'magg_list_kits' (listing). However, it doesn't explicitly differentiate from 'magg_reload_config' (reloading configuration), which might involve similar concepts.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., if a kit must exist from 'magg_list_kits'), exclusions (e.g., not for modifying servers directly), or comparisons to siblings like 'magg_reload_config' or 'magg_unload_kit', leaving the agent to infer usage context.

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

Related 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/sitbon/magg'

If you have feedback or need assistance with the MCP directory API, please join our Discord server