Skip to main content
Glama

magg_remove_server

Delete a specified server from the MAGG MCP server to manage and optimize server configurations effectively. Input the server name to execute the removal process.

Instructions

Remove a server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesServer name to remove

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNo
outputNo

Implementation Reference

  • Core handler for 'magg_remove_server' tool. Removes the specified server from configuration, saves config, unmounts the server, and returns appropriate success/error response.
    async def remove_server(
        self,
        name: Annotated[str, Field(description="Server name to remove")],
    ) -> MaggResponse:
        """Remove a server."""
        try:
            config = self.config
    
            if name in config.servers:
                config.remove_server(name)
    
                if not self.save_config(config):
                    return MaggResponse.error(f"Failed to save configuration after removing server '{name}'")
    
                await self.server_manager.unmount_server(name)
                return MaggResponse.success({
                    "action": "server_removed",
                    "server": {"name": name}
                })
            else:
                return MaggResponse.error(f"Server '{name}' not found")
    
        except Exception as e:
            return MaggResponse.error(f"Failed to remove server: {str(e)}")
  • The tools list in _register_tools() method that includes the registration tuple for 'magg_remove_server' using self.remove_server method and dynamic name f'{self_prefix_}remove_server'.
    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),
    ]
  • The registration loop that applies self.mcp.tool() decorator to each method in the tools list, including remove_server, using a wrapper.
    for method, tool_name, options in tools:
        self.mcp.tool(name=tool_name, **(options or {}))(call_tool_wrapper(method))
  • Helper method called by the handler to unmount the server: closes client, removes from FastMCP internals, and cleans up tracking.
    async def unmount_server(self, name: str) -> bool:
        """Unmount a server."""
        if name in self.mounted_servers:
            unmounted = self._unmount_from_fastmcp(name)
            if unmounted:
                logger.debug("Unmounted server %s from FastMCP", name)
            else:
                logger.debug("Server %s was not found in FastMCP's mounted servers", name)
    
            server_info = self.mounted_servers.get(name)
            if server_info and server_info.client:
                try:
                    await server_info.client.close()
                    logger.debug("Closed client for server %s", name)
                except Exception as e:
                    logger.warning("Error closing client for server %s: %s", name, e)
    
            del self.mounted_servers[name]
            logger.debug("Unmounted server %s", name)
            return True
    
        else:
            logger.warning("Server %s is not mounted, cannot unmount", name)
            return False
  • Input schema defined via Pydantic Annotated Field for the 'name' parameter.
    async def remove_server(
        self,
        name: Annotated[str, Field(description="Server name to remove")],
    ) -> 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. 'Remove a server' hints at a destructive operation but lacks details on permissions required, whether it's reversible, side effects (e.g., data loss), rate limits, or response behavior. This is inadequate for a mutation tool with zero 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 with zero waste, front-loaded with the core action. It's appropriately sized for a simple tool, avoiding unnecessary elaboration while clearly stating the purpose.

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

Completeness2/5

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

Given the tool's complexity (destructive operation with no annotations) and the presence of an output schema (which might cover return values), the description is incomplete. It fails to address critical aspects like safety, prerequisites, or differentiation from siblings, making it insufficient for informed use despite the output schema.

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 schema description coverage is 100%, with the parameter 'name' clearly documented as 'Server name to remove'. The description adds no additional meaning beyond this, such as format constraints or examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Remove a server' clearly states the action (remove) and target (server), but it's vague about what 'remove' entails (e.g., deletion, uninstallation, decommissioning) and doesn't distinguish it from siblings like 'magg_disable_server' or 'magg_unload_kit', which might have overlapping purposes. It avoids tautology by not just restating the name.

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 such as 'magg_disable_server' or 'magg_unload_kit', nor does it mention prerequisites like server state or dependencies. The description implies usage for removal but offers no context on exclusions or best practices.

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