Skip to main content
Glama

search_parallel

Execute multiple Google searches concurrently, retrieving titles, URLs, and snippets for each result. Submit up to 10 queries at once with adjustable result limits per query.

Instructions

Run multiple Google searches in parallel (pool of 4). Returns title/url/snippet per result. First call adds 5–10s setup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesQueries
limitNoMax results per query

Implementation Reference

  • src/index.ts:199-210 (registration)
    Tool registration for 'search_parallel' in the ListToolsRequestSchema handler. Defines name, description, and inputSchema (queries array + limit).
    {
      name: 'search_parallel',
      description: 'Run multiple Google searches in parallel (pool of 4). Returns title/url/snippet per result. First call adds 5–10s setup.',
      inputSchema: {
        type: 'object',
        properties: {
          queries: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: 10, description: 'Queries' },
          limit: { type: 'number', minimum: 1, maximum: 20, description: 'Max results per query' },
        },
        required: ['queries'],
      },
    },
  • Main handler for 'search_parallel' tool in CallToolRequestSchema. Parses args, calls ensurePool() then p.runMany(queries, limit) within trackPool() and withCaptchaFallback(). Returns JSON results with elapsed time.
    if (name === 'search_parallel') {
      const queries = (args?.queries as string[] || []).map(q => String(q).trim()).filter(Boolean);
      if (queries.length === 0) throw new McpError(ErrorCode.InvalidParams, 'queries required');
      const limit = Math.min(Math.max(Number(args?.limit) || 10, 1), 20);
    
      const t0 = Date.now();
      try {
        const results = await trackPool(() => withCaptchaFallback(
          async () => {
            const p = await ensurePool();
            return await withTimeout(p.runMany(queries, limit), REQUEST_TIMEOUT_MS * 2, 'search_parallel');
          },
          resetPool,
        ));
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({ results, elapsed_ms: Date.now() - t0 }, null, 2),
          }],
        };
      } catch (e) {
        console.error('[google-surf-mcp] search_parallel error:', e);
        return { content: [{ type: 'text', text: `Error: ${(e as Error).message}` }], isError: true };
      }
    }
  • SearchPool.runMany() method — the core execution logic. Runs multiple Google searches in parallel by Promise.all-mapping each query to searchOne(), which acquires a worker from the pool, runs search() on a page, and releases the worker.
    async runMany(queries: string[], limit = 10): Promise<PoolSearchResult[]> {
      if (!this.warmed) await this.warm();
      return Promise.all(queries.map((q) => this.searchOne(q, limit)));
    }
  • SearchPool.searchOne() — acquires a pool worker, runs a single Google search via the search() function, and releases the worker. Returns PoolSearchResult with query, results, and optional error.
    async searchOne(query: string, limit: number): Promise<PoolSearchResult> {
      if (!this.warmed) await this.warm();
      const w = await this.acquire();
      try {
        const page = await getPage(w.ctx);
        const results = await search(page, query, limit);
        return { query, results };
      } catch (e) {
        if (e instanceof CaptchaError) throw e;
        return { query, results: [], error: (e as Error).message };
      } finally {
        this.release(w);
      }
    }
  • Input schema for search_parallel: requires 'queries' (array of strings, 1-10 items) and optional 'limit' (1-20).
    inputSchema: {
      type: 'object',
      properties: {
        queries: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: 10, description: 'Queries' },
        limit: { type: 'number', minimum: 1, maximum: 20, description: 'Max results per query' },
      },
      required: ['queries'],
    },
Behavior4/5

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

Without annotations, the description effectively discloses key behaviors: parallel execution with a pool of 4, a 5-10 second setup on first call, and the returned fields (title, url, snippet). This adds significant context beyond the input schema.

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?

Two sentences are highly concise and front-loaded: the first sentence states the primary action, and the second adds critical setup time and output details. No extraneous words.

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?

Covers the main functional aspects: parallelism, pool size, setup cost, and output fields. Missing usage guidelines and error behavior, but for a search tool given no output schema, it is fairly complete.

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 coverage is 100% with basic descriptions for both parameters. The description adds tool-level context but does not enrich per-parameter semantics beyond what the schema provides, so baseline score applies.

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 runs multiple Google searches in parallel and returns title/url/snippet. It distinguishes from sibling tools by highlighting parallelism, but does not explicitly differentiate from similar tools like 'search' or 'search_extract'.

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 on when to use this tool versus alternatives like the single search tool. Only mentions a setup time on first call, which is more of a performance note than usage context.

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/HarimxChoi/google-surf-mcp'

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