Skip to main content
Glama

magg_unload_kit

Remove a specific kit and its associated servers from the MAGG MCP server configuration to streamline tool management and system performance.

Instructions

Unload a kit and optionally its servers from the configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesKit name to unload

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNo
outputNo

Implementation Reference

  • Handler for unload_kit tool: orchestrates unloading by modifying config, saving, and unmounting exclusive servers.
    async def unload_kit(
            self,
            name: Annotated[str, Field(description="Kit name to unload")],
    ) -> MaggResponse:
        """Unload a kit and optionally its servers from the configuration."""
        try:
            config = self.config
    
            servers_before = set(config.servers.keys())
    
            success, message = self.kit_manager.unload_kit_from_config(name, config)
    
            if success:
                if not self.save_config(config):
                    return MaggResponse.error("Failed to save configuration")
                servers_after = set(config.servers.keys())
                removed_servers = servers_before - servers_after
    
                for server_name in removed_servers:
                    if server_name in self.server_manager.mounted_servers:
                        await self.server_manager.unmount_server(server_name)
    
                return MaggResponse.success({
                    "action": "kit_unloaded",
                    "kit": name,
                    "message": message
                })
            else:
                return MaggResponse.error(message)
    
        except Exception as e:
            return MaggResponse.error(f"Failed to unload kit: {str(e)}")
  • Registration of magg_unload_kit tool in MaggServer._register_tools, mapping self.unload_kit to the tool name using self_prefix_.
    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.unload_kit_from_config: core logic to remove kit from config, remove/update servers exclusively from this kit.
    def unload_kit_from_config(self, kit_name: str, config: 'MaggConfig') -> tuple[bool, str]:
        """Unload a kit and optionally its servers from the configuration.
    
        Returns:
            Tuple of (success, message)
        """
        if kit_name not in config.kits:
            return False, f"Kit '{kit_name}' is not loaded"
    
        servers_to_remove = []
        servers_to_update = []
    
        for server_name, server_config in config.servers.items():
            if kit_name in server_config.kits:
                if len(server_config.kits) == 1:
                    servers_to_remove.append(server_name)
                else:
                    servers_to_update.append(server_name)
    
        for server_name in servers_to_update:
            config.servers[server_name].kits.remove(kit_name)
    
        for server_name in servers_to_remove:
            del config.servers[server_name]
    
        del config.kits[kit_name]
        self.remove_kit(kit_name)
    
        msg_parts = [f"Kit '{kit_name}' unloaded successfully"]
        if servers_to_remove:
            msg_parts.append(f"Removed servers: {', '.join(servers_to_remove)}")
        if servers_to_update:
            msg_parts.append(f"Updated servers: {', '.join(servers_to_update)}")
        return True, ". ".join(msg_parts)
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions the action ('unload') and optional server unloading, but lacks critical behavioral details: whether this is destructive, requires specific permissions, affects system state, has side effects, or what 'unload' means operationally. The description is too vague for a mutation tool with no annotation coverage.

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 front-loads the core action ('Unload a kit') and adds optional functionality ('and optionally its servers'). There is zero wasted verbiage, making it highly concise and well-structured for quick comprehension.

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 mutation tool ('unload') that likely changes system state, the description should provide more context about behavior, risks, or dependencies to be fully complete, especially with sibling tools suggesting complex configuration management.

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

Parameters4/5

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

Schema description coverage is 100%, with the single parameter 'name' documented as 'Kit name to unload'. The description adds context by specifying it's for unloading 'a kit', aligning with the parameter. Since there's only one parameter and schema coverage is complete, the baseline is high, and the description reinforces without contradiction.

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 verb ('unload') and resource ('a kit'), specifying it's from 'the configuration'. It distinguishes from siblings like 'magg_load_kit' (opposite action) and 'magg_kit_info' (read-only). However, it doesn't explicitly mention what 'unload' entails compared to similar tools like 'magg_remove_server', leaving some ambiguity.

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

Usage Guidelines3/5

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

The description implies usage when needing to remove a kit from configuration, with optional server unloading. It suggests an alternative scenario (unloading kit only vs. kit+servers) but doesn't provide explicit guidance on when to use this tool versus siblings like 'magg_remove_server' or 'magg_disable_server', nor does it mention prerequisites or exclusions.

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