Skip to main content
Glama
MissionSquad

@missionsquad/mcp-searxng-puppeteer

Official

web_search

Perform web searches using SearXNG API to gather information, find news and articles, or explore diverse online sources for general queries and recent events.

Instructions

Performs a web search using the SearXNG API, ideal for general queries, news, articles, and online content. Use this for broad information gathering, recent events, or when you need diverse web sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query. This is the main input for the web search
pagenoNoSearch page number (starts at 1)
countNoNumber of results per page (default: 10)
time_rangeNoTime range of search (day, month, year)
languageNoLanguage code for search results (e.g., 'en', 'fr', 'de'). Default is instance-dependent.
safesearchNoSafe search filter level (0: None, 1: Moderate, 2: Strict) (default: 0)

Implementation Reference

  • The core handler function that performs the web search. It constructs the SearXNG API URL with provided parameters, fetches JSON results, processes them, and returns formatted text output with titles, descriptions, and URLs.
    async function performWebSearch(
      query: string,
      pageno: number = 1,
      count: number = 10,
      time_range?: string,
      language: string = "all",
      safesearch?: string
    ) {
      const searxngUrl = process.env.SEARXNG_URL || "http://localhost:8080";
      const url = new URL(`${searxngUrl}/search`);
      url.searchParams.set("q", query);
      url.searchParams.set("format", "json");
      url.searchParams.set("pageno", pageno.toString());
      url.searchParams.set("count", count.toString());
    
      if (
        time_range !== undefined &&
        ["day", "month", "year"].includes(time_range)
      ) {
        url.searchParams.set("time_range", time_range);
      }
    
      if (language && language !== "all") {
        url.searchParams.set("language", language);
      }
    
      if (safesearch !== undefined && ["0", "1", "2"].includes(safesearch)) {
        url.searchParams.set("safesearch", safesearch);
      }
    
      const response = await fetch(url.toString(), {
        method: "GET",
      });
    
      if (!response.ok) {
        throw new Error(
          `SearXNG API error: ${response.status} ${
            response.statusText
          }\n${await response.text()}`
        );
      }
    
      const data = (await response.json()) as SearXNGWeb;
    
      const results = (data.results || []).map((result) => ({
        title: result.title || "",
        content: result.content || "",
        url: result.url || "",
      }));
    
      return results
        .map((r) => `Title: ${r.title}\nDescription: ${r.content}\nURL: ${r.url}`)
        .join("\n\n");
    }
  • Defines the complete Tool object for 'web_search', including name, description, and detailed inputSchema with properties, defaults, enums, and required fields.
    const WEB_SEARCH_TOOL: Tool = {
      name: "web_search",
      description:
        "Performs a web search using the SearXNG API, ideal for general queries, news, articles, and online content. " +
        "Use this for broad information gathering, recent events, or when you need diverse web sources.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description:
              "The search query. This is the main input for the web search",
          },
          pageno: {
            type: "number",
            description: "Search page number (starts at 1)",
            default: 1,
          },
          count: {
            type: "number",
            description: "Number of results per page (default: 10)",
            default: 10,
          },
          time_range: {
            type: "string",
            description: "Time range of search (day, month, year)",
            enum: ["day", "month", "year"],
          },
          language: {
            type: "string",
            description:
              "Language code for search results (e.g., 'en', 'fr', 'de'). Default is instance-dependent.",
          },
          safesearch: {
            type: "string",
            description:
              "Safe search filter level (0: None, 1: Moderate, 2: Strict) (default: 0)",
            enum: ["0", "1", "2"],
          },
        },
        required: ["query"],
      },
    };
  • index.ts:88-91 (registration)
    Registers the web_search tool in the MCP server capabilities section, referencing the tool's description and input schema.
    web_search: {
      description: WEB_SEARCH_TOOL.description,
      schema: WEB_SEARCH_TOOL.inputSchema,
    },
  • index.ts:246-248 (registration)
    Registers the web_search tool (via WEB_SEARCH_TOOL constant) in the response handler for listing available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [WEB_SEARCH_TOOL, READ_URL_TOOL],
    }));
  • Type guard helper function to validate and type-check the input arguments for the web_search tool.
    function isSearXNGWebSearchArgs(args: unknown): args is {
      query: string;
      pageno?: number;
      count?: number;
      time_range?: string;
      language?: string;
      safesearch?: string;
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "query" in args &&
        typeof (args as { query: string }).query === "string"
      );
    }
Behavior2/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 mentions the API (SearXNG) and general use cases but lacks critical details like rate limits, authentication needs, error handling, or response format. For a tool with no annotations, this leaves significant gaps in understanding its operational behavior.

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 front-loaded with the core purpose and efficiently lists ideal use cases in two concise sentences. Every sentence adds value without redundancy, making it easy to scan and understand 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 complexity (6 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers purpose and usage well but lacks behavioral details and output information, which are crucial for effective tool invocation in this context.

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?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, such as examples or contextual usage tips. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 tool performs web searches using the SearXNG API, specifying it's for general queries, news, articles, and online content. It distinguishes from the sibling tool 'get_url_content' by focusing on search rather than content retrieval, though the distinction could be more explicit.

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

Usage Guidelines4/5

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

The description provides clear usage contexts: broad information gathering, recent events, and when diverse web sources are needed. It implies when to use this tool but doesn't explicitly state when to use the sibling 'get_url_content' or provide exclusions, which keeps it from a perfect score.

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

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