Skip to main content
Glama

fetch_batch

Read-only

Fetch multiple URLs concurrently using HTTP/2 multiplexing and connection pooling to retrieve web content efficiently with timing results.

Instructions

Fetch multiple URLs in parallel with HTTP/2 multiplexing.

Uses connection pooling and multiplexing for maximum efficiency. All URLs are fetched concurrently.

Returns: Results for each URL with timing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYes

Implementation Reference

  • The core implementation of `fetch_batch` which utilizes `ThreadPoolExecutor` for parallel URL fetching.
    def fetch_batch(self, urls: List[str], parallel: int = 5) -> List[NabResult]:
        """Fetch multiple URLs in parallel.
    
        Args:
            urls: List of URLs to fetch.
            parallel: Maximum concurrent fetches.
    
        Returns:
            List of NabResult in the same order as input URLs.
            Failed fetches are included with empty markdown and status=0.
        """
        results: dict[int, NabResult] = {}
    
        with ThreadPoolExecutor(max_workers=parallel) as pool:
            future_to_idx = {pool.submit(self._safe_fetch, url): i for i, url in enumerate(urls)}
            for future in as_completed(future_to_idx):
                idx = future_to_idx[future]
                results[idx] = future.result()
    
        return [results[i] for i in range(len(urls))]
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=true; description adds valuable implementation context beyond these annotations, specifically HTTP/2 multiplexing, connection pooling, and that results include timing information. Does not mention rate limits 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?

Four tightly focused sentences: purpose first, implementation details second, concurrency confirmation third, return value fourth. Zero redundancy; technical details (HTTP/2, pooling) earned their place by explaining performance characteristics.

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?

Appropriate for a focused utility with existing output schema. Covers execution model (concurrent), transport mechanism (HTTP/2), and return characteristics (timing). Lacks error handling or timeout behavior details, but sufficient given tool simplicity.

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 has 0% description coverage for the single 'urls' parameter. Description mentions 'URLs' in the action statement but does not explicitly document the parameter format, validation rules, or constraints (e.g., max URLs, protocol requirements). Marginal compensation for missing schema documentation.

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?

Description clearly states 'Fetch multiple URLs in parallel with HTTP/2 multiplexing' - specific verb, resource, and technical method. Distinguishes from sibling 'fetch' by emphasizing 'multiple' and 'parallel' operations.

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

Usage Guidelines3/5

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

Implies batch usage through 'multiple URLs' and 'concurrently', but lacks explicit guidance on when to prefer this over the single 'fetch' sibling or prerequisites (e.g., URL validation requirements). No alternatives or exclusions named.

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/MikkoParkkola/nab'

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