Skip to main content
Glama
netixc

SearXNG MCP Server

search_media

Find images or videos using a privacy-focused search tool that aggregates results from multiple engines without tracking user data.

Instructions

Search for images or videos.

Use this when:

  • User wants to find images or photos

  • Looking for video content

  • "show me pictures of..." or "find videos about..."

Parameters: query* - What to find media_type - "images" or "videos" (default: images) engines - Optional: Specific engines max_results - Number of results (default: 10, max: 50)

Returns: Media URLs with thumbnails and sources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesMedia search query
media_typeNoType of mediaimages
enginesNoComma-separated engine list
max_resultsNoMaximum results

Implementation Reference

  • The core handler function implementing the search_media tool logic. It queries the SearXNG API with the specified media category (images/videos), processes the results, and formats them into a markdown-style TextContent response.
    def search_media(
        self,
        query: str,
        media_type: Literal["images", "videos"] = "images",
        engines: Optional[str] = None,
        max_results: int = 10
    ) -> List[TextContent]:
        """Search for images or videos.
    
        Args:
            query: Search query
            media_type: "images" or "videos"
            engines: Comma-separated engine list
            max_results: Maximum results to return
    
        Returns:
            Formatted media search results
        """
        results = self._search(query, category=media_type, engines=engines)
    
        if media_type == "images":
            output = f"🖼️ Image Results for: {query}\n\n"
            for i, result in enumerate(results.get("results", [])[:max_results], 1):
                output += f"{i}. **{result.get('title', 'No title')}**\n"
                output += f"   URL: {result.get('img_src', 'N/A')}\n"
                output += f"   Source: {result.get('url', 'N/A')}\n"
                if result.get('thumbnail_src'):
                    output += f"   Thumbnail: {result['thumbnail_src']}\n"
                output += "\n"
        else:  # videos
            output = f"🎥 Video Results for: {query}\n\n"
            for i, result in enumerate(results.get("results", [])[:max_results], 1):
                output += f"{i}. **{result.get('title', 'No title')}**\n"
                output += f"   {result.get('url', '')}\n"
                if result.get('content'):
                    output += f"   {result['content']}\n"
                if result.get('publishedDate'):
                    output += f"   Published: {result['publishedDate']}\n"
                output += "\n"
    
        if not results.get("results"):
            output += f"No {media_type} found.\n"
    
        return [TextContent(type="text", text=output)]
  • MCP tool registration for search_media using FastMCP decorator, including input schema via Annotated Fields. Delegates execution to the SearchTools instance.
    @self.mcp.tool(description=SEARCH_MEDIA_DESC)
    def search_media(
        query: Annotated[str, Field(description="Media search query")],
        media_type: Annotated[Literal["images", "videos"], Field(description="Type of media")] = "images",
        engines: Annotated[Optional[str], Field(description="Comma-separated engine list")] = None,
        max_results: Annotated[int, Field(description="Maximum results", ge=1, le=50)] = 10
    ):
        return self.search_tools.search_media(query, media_type, engines, max_results)
  • Tool description string providing usage guidelines, parameters, and return format for the search_media tool.
    SEARCH_MEDIA_DESC = """Search for images or videos.
    
    Use this when:
    - User wants to find images or photos
    - Looking for video content
    - "show me pictures of..." or "find videos about..."
    
    Parameters:
    query* - What to find
    media_type - "images" or "videos" (default: images)
    engines - Optional: Specific engines
    max_results - Number of results (default: 10, max: 50)
    
    Returns: Media URLs with thumbnails and sources"""
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 adds some context about default values and limits (default: images, max_results default: 10, max: 50) and describes the return format ('Media URLs with thumbnails and sources'), but doesn't cover important behavioral aspects like rate limits, authentication requirements, pagination, or error handling.

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 well-structured and appropriately sized with clear sections (purpose, usage guidelines, parameters, returns). Every sentence earns its place by providing distinct information. The front-loaded purpose statement is followed by logically organized supporting details without redundancy.

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

Completeness4/5

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

For a search tool with 4 parameters (100% schema coverage) and no annotations/output schema, the description is reasonably complete. It covers purpose, usage scenarios, parameters, and return values. However, it lacks some behavioral context that would be helpful for an AI agent, such as performance characteristics or error conditions.

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 all parameters thoroughly. The description adds minimal value beyond the schema by repeating parameter names and basic constraints, but doesn't provide additional semantic context like query formatting examples, engine options, or result quality considerations. The baseline of 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.

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 ('Search for images or videos') and resources ('images or videos'), distinguishing it from sibling tools like 'research_topic' and 'search' by focusing specifically on media content. The opening sentence directly communicates the core function without ambiguity.

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 guidelines with a dedicated 'Use this when:' section listing three concrete scenarios (finding images/photos, looking for video content, and example queries). This clearly indicates when to use this tool versus alternatives, though it doesn't explicitly name sibling tools as alternatives.

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/netixc/SearxngMCP'

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