Skip to main content
Glama

magg_search_servers

Search for MCP servers dynamically to extend LLM capabilities by querying and managing server configurations with defined result limits.

Instructions

Search for MCP servers online.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return per search source
queryYesSearch query for MCP servers

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorsNo
outputNo

Implementation Reference

  • The core handler function for the 'magg_search_servers' tool. It takes a query and optional limit, uses CatalogManager to search for MCP servers, formats the results, and returns them via MaggResponse.
    async def search_servers(
        self,
        query: Annotated[str, Field(description="Search query for MCP servers")],
        limit: Annotated[int, Field(description="Maximum number of results to return per search source")] = 5,
    ) -> MaggResponse:
        """Search for MCP servers online."""
        try:
            catalog = CatalogManager()
            results = await catalog.search_only(query, limit)
    
            search_results = []
            for source, items in results.items():
                for item in items:
                    result_data = {
                        "source": source,
                        "name": item.name,
                        "description": item.description
                    }
                    if item.url:
                        result_data["url"] = item.url
                    if hasattr(item, 'install_command') and item.install_command:
                        result_data["install_command"] = item.install_command
                    search_results.append(result_data)
    
            return MaggResponse.success({
                "query": query,
                "results": search_results,
                "total": len(search_results)
            })
    
        except Exception as e:
            return MaggResponse.error(f"Failed to search servers: {str(e)}")
  • The _register_tools method that registers the 'magg_search_servers' tool by including (self.search_servers, f'{self_prefix_}search_servers', None) in the tools list and calling self.mcp.tool() with the handler wrapped.
    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()
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 of behavioral disclosure. It mentions 'online' search, implying network access, but doesn't cover critical aspects like rate limits, authentication needs, error handling, or what 'online' entails (e.g., external APIs, databases). This is a significant gap for a search 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 with zero waste. It's front-loaded and appropriately sized for a simple search tool, making it easy for an agent to parse quickly.

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's low complexity (2 parameters, no nested objects) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and incomplete behavioral context, it doesn't fully compensate for the lack of structured safety or operational details.

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 clear documentation for both parameters ('query' and 'limit'). The description adds no additional parameter semantics beyond what the schema provides, such as query format examples or limit constraints. Baseline 3 is appropriate when 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 ('Search for') and resource ('MCP servers online'), making the purpose understandable. However, it doesn't differentiate from siblings like 'magg_list_servers' or 'magg_analyze_servers', which likely have different search/filtering approaches, so it misses full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives such as 'magg_list_servers' or 'magg_analyze_servers'. It lacks context on use cases, exclusions, or prerequisites, leaving the agent to infer usage from the tool name 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