Skip to main content
Glama
martinchen448

SearXNG MCP Server

get_suggestions

Generate autocomplete suggestions for search queries to discover related terms and improve query formulation.

Instructions

Get search suggestions/autocomplete for a query prefix.

This tool provides search suggestions based on a partial query, similar to autocomplete functionality in search engines. Useful for discovering related searches or expanding on a topic.

Use this when you need to:

  • Get autocomplete suggestions for a search

  • Discover related search terms

  • Help users formulate better search queries

  • Explore variations of a search topic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe query prefix to get suggestions for
languageNoLanguage code for suggestions (default: 'en')en

Implementation Reference

  • MCP server tool handler for get_suggestions: extracts arguments, calls client.get_suggestions, formats and returns JSON response as TextContent
    elif name == "get_suggestions":
        suggestions = await client.get_suggestions(
            query=arguments["query"],
            language=arguments.get("language", "en"),
        )
    
        return [
            TextContent(
                type="text",
                text=json.dumps(
                    {"query": arguments["query"], "suggestions": suggestions},
                    indent=2,
                ),
            )
        ]
  • SearXNGClient.get_suggestions: makes HTTP GET to /autocomplete endpoint with query and language params, returns list of suggestions from JSON response
    async def get_suggestions(
        self,
        query: str,
        language: str = "en",
    ) -> List[str]:
        """Get search suggestions for a query prefix.
    
        Args:
            query: The query prefix
            language: Language code for suggestions
    
        Returns:
            List of suggestion strings
    
        Raises:
            httpx.HTTPError: If the request fails
        """
        url = urljoin(self.base_url, "/autocomplete")
    
        params = {
            "q": query,
            "language": language,
        }
    
        response = await self.client.get(url, params=params)
        response.raise_for_status()
    
        # Autocomplete returns a simple list
        return response.json()
  • Registration of get_suggestions tool in list_tools(): defines name, description, and inputSchema
                    Tool(
                        name="get_suggestions",
                        description="""Get search suggestions/autocomplete for a query prefix.
                        
    This tool provides search suggestions based on a partial query, similar to autocomplete
    functionality in search engines. Useful for discovering related searches or expanding
    on a topic.
    
    Use this when you need to:
    - Get autocomplete suggestions for a search
    - Discover related search terms
    - Help users formulate better search queries
    - Explore variations of a search topic""",
                        inputSchema={
                            "type": "object",
                            "properties": {
                                "query": {
                                    "type": "string",
                                    "description": "The query prefix to get suggestions for",
                                },
                                "language": {
                                    "type": "string",
                                    "description": "Language code for suggestions (default: 'en')",
                                    "default": "en",
                                },
                            },
                            "required": ["query"],
                        },
                    ),
  • Input schema definition for get_suggestions tool: requires 'query', optional 'language' with defaults
    inputSchema={
        "type": "object",
        "properties": {
            "query": {
                "type": "string",
                "description": "The query prefix to get suggestions for",
            },
            "language": {
                "type": "string",
                "description": "Language code for suggestions (default: 'en')",
                "default": "en",
            },
        },
        "required": ["query"],
    },
Behavior3/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. It adequately describes the core functionality (autocomplete suggestions) but lacks details about rate limits, response format, error conditions, or performance characteristics. The description doesn't contradict any annotations since none exist.

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 well-structured with a clear opening statement followed by a purpose explanation and specific usage guidelines. While slightly verbose in the bulleted list, every sentence adds value and the information is front-loaded appropriately for an AI agent.

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?

For a read-only tool with no annotations and no output schema, the description provides adequate context about what the tool does and when to use it. However, it lacks information about return values, error handling, and operational constraints that would be helpful given the absence of structured metadata.

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%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'query prefix' and 'search suggestions' context, but doesn't provide additional syntax, format, or constraint details. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Get search suggestions/autocomplete') and resource ('for a query prefix'), distinguishing it from siblings like 'search' by focusing on autocomplete rather than full search results. It explicitly mentions similarity to search engine autocomplete functionality.

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

Usage Guidelines5/5

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

The description provides explicit usage scenarios in a bulleted list: getting autocomplete suggestions, discovering related terms, helping formulate queries, and exploring search variations. It clearly indicates when to use this tool versus alternatives like 'search' by focusing on partial queries and discovery.

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

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/martinchen448/searxng-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server