Skip to main content
Glama

magg_disable_server

Disable a specified server on the MAGG MCP server to manage and control server operations. Input the server name to deactivate it.

Instructions

Disable a server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesServer name to disable

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNo
outputNo

Implementation Reference

  • The core handler function for the 'magg_disable_server' MCP tool. It disables the specified server by setting enabled=False in config, saves the config, unmounts the server, and returns a success/error response.
    async def disable_server(
        self,
        name: Annotated[str, Field(description="Server name to disable")],
    ) -> MaggResponse:
        """Disable a server."""
        try:
            config = self.config
    
            if name not in config.servers:
                return MaggResponse.error(f"Server '{name}' not found")
    
            server = config.servers[name]
    
            if not server.enabled:
                return MaggResponse.error(f"Server '{name}' is already disabled")
    
            server.enabled = False
    
            if not self.save_config(config):
                return MaggResponse.error(f"Failed to save configuration for server '{name}'")
    
            await self.server_manager.unmount_server(name)
    
            return MaggResponse.success({
                "action": "server_disabled",
                "server": {"name": name}
            })
    
        except Exception as e:
            return MaggResponse.error(f"Failed to disable server: {str(e)}")
  • Registration of the 'magg_disable_server' tool (line 53) within the _register_tools method of MaggServer class. The tool is registered using FastMCP's self.mcp.tool() with the name constructed as f'{self_prefix_}disable_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),
    ]
    
    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))
  • Input schema for the tool defined via Pydantic Annotated Field: server name (str) required.
    async def disable_server(
        self,
        name: Annotated[str, Field(description="Server name to disable")],
    ) -> MaggResponse:
  • CLI command 'magg server disable' that mirrors the tool logic for disabling a server via config file directly.
    async def cmd_disable_server(args) -> int:
        """Disable a server."""
        config_manager = ConfigManager(args.config)
        config = config_manager.load_config()
    
        if args.name not in config.servers:
            print_error(f"Server '{args.name}' not found")
            return 1
    
        server = config.servers[args.name]
        if not server.enabled:
            print_info(f"Server '{args.name}' is already disabled")
            return 0
    
        server.enabled = False
    
        if config_manager.save_config(config):
            print_success(f"Disabled server '{args.name}'")
            print_text("If Magg is running, the server will be automatically unmounted")
            return 0
        else:
            print_error("Failed to save configuration")
            return 1
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. 'Disable' implies a state change (likely from enabled to disabled), but it doesn't disclose if this is reversible, requires specific permissions, affects server functionality, or has side effects (e.g., stopping services). For a mutation tool with zero annotation coverage, this is inadequate.

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, direct sentence with zero wasted words. It is front-loaded with the core action and resource, making it highly efficient. Every word earns its place, achieving maximum clarity in minimal space.

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 a mutation tool with no annotations, 1 parameter (fully documented in schema), and an output schema (which handles return values), the description is minimally complete. It states what the tool does but lacks crucial context like behavioral traits, usage guidelines, and operational details, leaving gaps for safe and effective use.

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?

Schema description coverage is 100%, with the single parameter 'name' clearly documented as 'Server name to disable'. The description adds no additional parameter context beyond what the schema provides, such as format examples or validation rules. Baseline 3 is appropriate since the schema does 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 ('disable') and resource ('a server'), making the purpose immediately understandable. It distinguishes from siblings like 'magg_enable_server' (opposite action) and 'magg_remove_server' (different operation). However, it doesn't specify what 'disable' entails operationally, 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 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., server must be enabled), exclusions (e.g., cannot disable if in use), or relationships to siblings like 'magg_enable_server' for re-enabling or 'magg_remove_server' for deletion. The agent must infer usage from context alone.

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