Skip to main content
Glama

Crawl Single

crawl_single

Extracts main-content Markdown from a single known URL, using fast parsing first and automatically falling back to cloud or browser rendering for failed, short, or JavaScript-heavy pages.

Instructions

爬取单个网页(自动降级:快速提取 → Cloud 兜底 → 浏览器渲染)

适用于已经知道一个明确 URL、需要提取该页面正文 Markdown 的场景。 默认先尝试轻量级快速提取(适合静态文章/文档页),失败、内容过短或检测到 SPA 骨架页时 自动切换到浏览器渲染。若要从一个入口页继续发现站内链接,请使用 crawl_site; 若已有多个明确 URL,请使用 crawl_batch。

参数组合:

  • 默认 prefer_fast=True:先快提取,必要时 fallback 到浏览器。

  • prefer_fast=False:跳过快速提取,强制直接使用浏览器。

  • enhanced=True:只影响浏览器路径(不改变快速提取行为)——深度模式: 等正文实文本出现即返回(替代盲等,实测浏览器耗时砍半:BBC 20s→9s)+ PruningContentFilter 剪掉导航/boilerplate(实测导航行 32%→0.8%)+ 随机 UA/拟人信号/删弹窗。代价是图片会被剪掉;要图片用 enhanced=False。 强制浏览器增强需同时设置 prefer_fast=False, enhanced=True。

  • css_selector / excluded_selector / scan_full_page:只在浏览器路径生效 (快速提取成功时被忽略)。需要强制生效配合 prefer_fast=False。

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": {
      "url": "<url>"
    },
    "name": "crawl_single"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes要爬取的网页 URL
enhancedNo浏览器增强模式:等渲染更久 + 正文剪枝(去导航/boilerplate,
llm_configNo[实验性] LLM 后处理配置(可选),需设置 CRAWL_MCP_API_KEY 才生效。 支持三种格式: - 字典: {"instruction": "总结", "schema": {...}} - JSON 字符串: '{"instruction": "总结"}' - 纯文本: "总结页面内容"(自动作为 instruction) 未设置 API Key 时跳过,结果中包含 llm_skipped 提示。
prefer_fastNo是否优先尝试快速提取(默认 True)。设为 False 时强制浏览器爬取。
css_selectorNo只提取匹配元素内的正文,如 "article" / "#content" / "main"。 页面导航/侧栏/评论区噪声多时用;仅在浏览器路径生效。
scan_full_pageNo滚动加载整页后再提取(默认 False)。无限滚动/长列表页 (信息流、定价表)内容只在前几屏时设 True;仅在浏览器路径生效。
excluded_selectorNo排除匹配的元素(逗号分隔多个),如 "nav,footer,aside,.ads"。 仅在浏览器路径生效。
min_content_lengthNo快速提取结果的最小内容长度阈值(默认 200 字符)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.2.1
    • addedInput schema / properties / css_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "只提取匹配元素内的正文,如 \"article\" / \"#content\" / \"main\"。\n页面导航/侧栏/评论区噪声多时用;仅在浏览器路径生效。"
      +}
    • changedInput schema / properties / enhanced / description
      Previous value: -"浏览器增强模式。适用于 SPA/慢加载页面,等待时间更长;仅在浏览器路径生效。"New value: +"浏览器增强模式:等渲染更久 + 正文剪枝(去导航/boilerplate,"
    • addedInput schema / properties / excluded_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "排除匹配的元素(逗号分隔多个),如 \"nav,footer,aside,.ads\"。\n仅在浏览器路径生效。"
      +}
    • changedInput schema / properties / llm_config / description
      Previous value: -"[实验性] LLM 后处理配置(可选),需设置 CRAWL_MCP_API_KEY 才生效。\n支持三种格式:\n- 字典: {\"instruction\": \"总结\", \"schema\": {...}}\n- JSON 字符串: '{\"instruction\": \"总结\"}'\n- 纯文本: \"总结页面内容\"(自动作为 instruction)\n未设置 API Key 时传此参数会优雅跳过,结果中包含 llm_skipped 提示。"New value: +"[实验性] LLM 后处理配置(可选),需设置 CRAWL_MCP_API_KEY 才生效。\n支持三种格式:\n- 字典: {\"instruction\": \"总结\", \"schema\": {...}}\n- JSON 字符串: '{\"instruction\": \"总结\"}'\n- 纯文本: \"总结页面内容\"(自动作为 instruction)\n未设置 API Key 时跳过,结果中包含 llm_skipped 提示。"
    • addedInput schema / properties / scan_full_page
      Added value: +{
      +  "default": false,
      +  "description": "滚动加载整页后再提取(默认 False)。无限滚动/长列表页\n(信息流、定价表)内容只在前几屏时设 True;仅在浏览器路径生效。",
      +  "type": "boolean"
      +}
  2. First observedv0.2.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does most of it: automatic degradation on failure/short content/SPA skeleton, that enhanced only touches the browser path, and the concrete cost ("图片会被剪掉;要图片用 enhanced=False"). It stops short of stating what happens when all tiers fail or any auth/rate-limit constraints, leaving a gap for a network-bound tool.

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?

Front-loaded with the one-line purpose and degradation order, then a sibling-routing sentence, then a structured 参数组合 list. The benchmark asides (BBC 20s→9s, 导航行 32%→0.8%) justify the enhanced trade-off rather than padding, and every bullet maps to an actual parameter.

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

Completeness5/5

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

An output schema exists, so return values need no explanation, and all 8 parameters plus the required url are addressed in the prose or schema. For a multi-path crawler with subtle path-dependent parameters, the description covers the decisions an agent must make before calling.

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 already 100%, so the baseline is 3, but the description adds real meaning the schema does not: the interaction rule that enhanced requires prefer_fast=False to take effect, and the trade-off that enhanced pruning removes images. The selector/scan_full_page note that they are ignored on a successful fast path is partly duplicated from the schema, so it does not reach a 5.

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 opens with a specific verb+resource ("爬取单个网页") and immediately states the fallback chain (快速提取 → Cloud 兜底 → 浏览器渲染). It explicitly separates itself from crawl_site (link discovery from an entry page) and crawl_batch (multiple known URLs), 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 triggering condition ("已经知道一个明确 URL、需要提取该页面正文 Markdown") and names both alternatives with the condition that selects each (crawl_site for discovery, crawl_batch for many URLs). It goes further with explicit parameter-combination guidance, e.g. "强制浏览器增强需同时设置 prefer_fast=False, enhanced=True".

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