Skip to main content
Glama

magg_analyze_servers

Analyze configured servers to generate actionable insights using LLM, enhancing server management and performance optimization.

Instructions

Analyze configured servers and provide insights using LLM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the tool logic: analyzes configured servers, computes statistics, and optionally uses an LLM (via provided Context) to generate insights.
        async def analyze_servers(
            self,
            ctx: Context | None = None,
        ):
            """Analyze configured servers and provide insights using LLM."""
            try:
                config = self.config
    
                if not config.servers:
                    return MaggResponse.success({
                        "analysis": f"No servers configured yet. Use {self.self_prefix_}add_server to add servers."
                    })
    
                analysis_data = {
                    "total_servers": len(config.servers),
                    "enabled_servers": len(config.get_enabled_servers()),
                    "mounted_servers": len(self.server_manager.mounted_servers),
                    "servers": {}
                }
    
                for name, server in config.servers.items():
                    server_info = {
                        "source": server.source,
                        "enabled": server.enabled,
                        "mounted": name in self.server_manager.mounted_servers,
                        "command": server.command,
                        "uri": server.uri,
                        "prefix": server.prefix,
                        "notes": server.notes
                    }
                    analysis_data["servers"][name] = server_info
    
                if ctx:
                    prompt = f"""Analyze this Magg server configuration and provide insights:
    
    {json.dumps(analysis_data, indent=2)}
    
    Please provide:
    1. Overview of the current setup
    2. Any potential issues or conflicts
    3. Suggestions for optimization
    4. Missing capabilities that could be added"""
    
                    result = await ctx.sample(
                        messages=prompt,
                        max_tokens=1000
                    )
    
                    if result and result.text:
                        analysis_data["insights"] = result.text
    
                return MaggResponse.success(analysis_data)
    
            except Exception as e:
                return MaggResponse.error(f"Failed to analyze servers: {str(e)}")
  • Registers the analyze_servers method as the tool named f'{self.self_prefix_}analyze_servers' (likely 'magg_analyze_servers') within the list of Magg management tools, using FastMCP's tool decorator.
    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))
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'using LLM' which hints at AI processing, but doesn't disclose behavioral traits such as whether it's read-only or destructive, performance characteristics, or what the insights output looks like. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core function without unnecessary words. It's appropriately sized for a no-parameter tool, though it could be more front-loaded with key details like output format. No wasted text, but room for slight improvement in structure.

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 complexity implied by 'analyze' and 'using LLM', and the lack of annotations and output schema, the description is incomplete. It doesn't explain what insights are provided, the format of the output, or how the LLM processing works. For a tool that likely returns complex analysis, more context is needed to be useful.

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?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it correctly doesn't mention any. Baseline is 4 for zero parameters, as there's nothing to compensate for.

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 states the action ('analyze') and target ('configured servers'), but it's vague about what 'analyze' entails and what 'insights' are provided. It doesn't differentiate from siblings like 'magg_list_servers' or 'magg_search_servers' that might also provide server information. The purpose is understandable but lacks specificity.

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 like 'magg_list_servers' or 'magg_status'. The description mentions 'using LLM', but it doesn't explain when this LLM-based analysis is preferred over simpler listing or status checks. There's no mention of 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