Skip to main content
Glama

Crawl Batch

crawl_batch

Fetch multiple known URLs in parallel, using fast extraction first and browser fallback for failed, short, or SPA pages.

Instructions

批量爬取多个网页(自动降级版)

适用于已经有一组明确 URL、需要并行抓取多个页面的场景。 默认对所有 URL 并行快速提取;只有失败、内容过短或 SPA 骨架页才进入浏览器 fallback。 若只有一个 URL,请使用 crawl_single;若只有入口页并希望发现站内链接,请使用 crawl_site。

参数组合:

  • prefer_fast=True:静态页走快速路径,失败项才走浏览器 fallback。

  • prefer_fast=False:所有 URL 都直接走浏览器,不返回 fast/fallback 方法标记。

  • min_content_length 只影响快速提取是否被认为足够完整。

  • css_selector / excluded_selector 只在浏览器路径生效(快速提取成功时被忽略)。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "urls": "<urls>"
    },
    "name": "crawl_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlsYesURL 列表
concurrentNo网页爬取并发数(默认:3)
llm_configNo[实验性] LLM 后处理配置(可选),需设置 CRAWL_MCP_API_KEY 才生效
prefer_fastNo是否优先尝试快速提取(默认 True)
css_selectorNo只提取匹配元素内的正文(如 "article"),适合一批同构页面; 仅在浏览器路径生效
llm_concurrentNoLLM 处理并发数(默认:3)
excluded_selectorNo排除匹配的元素(如 "nav,footer,aside"); 仅在浏览器路径生效
min_content_lengthNo快速提取最小内容长度阈值(默认 200 字符)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.1
    • addedInput schema / properties / css_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "只提取匹配元素内的正文(如 \"article\"),适合一批同构页面;\n仅在浏览器路径生效"
      +}
    • addedInput schema / properties / excluded_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "排除匹配的元素(如 \"nav,footer,aside\");\n仅在浏览器路径生效"
      +}
  2. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are supplied, so the description fully carries the burden, and it does disclose the key non-obvious behavior: a fast-path-first strategy where only failures, short content, or SPA skeletons trigger browser fallback, and that prefer_fast=False removes fast/fallback method markers from results. It stops short of covering cost/latency trade-offs, auth requirements for the browser path, or partial-failure semantics across the batch.

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?

Front-loaded with purpose, then scenario, then fallback policy, then alternatives, then a parameter-combination list — a strong structure. Minor redundancy between the '默认…并行快速提取' sentence and the prefer_fast=True bullet keeps it from a 5.

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?

With 8 parameters, an output schema, and 100% schema coverage, the description supplies the behavioral layer the structured fields cannot. The remaining gap is how batch-level failures are reported, though the output schema plausibly covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds genuine semantics beyond the schema: the two prefer_fast modes and their differing behavior, that min_content_length only governs fast-path sufficiency, and that the selectors are silently ignored when fast extraction succeeds. concurrent and llm_concurrent are left to the schema, which is acceptable.

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 names a specific verb and resource (批量爬取多个网页) and scopes it to a batch of known URLs. It explicitly names the two siblings it is not — crawl_single for a single URL and crawl_site for link discovery — so an agent can route without opening any schema.

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?

It states the exact scenario (already have a defined URL list, need parallel fetching) and gives explicit when-not-to-use rules that point at named alternatives. This is the clearest possible routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.