web_index
Reads a site's sitemap, inventories page URLs, and compares them with the previous snapshot to report added, changed, unchanged, and removed pages, with optional regex filters and content diff checks.
Instructions
读取站点的 sitemap,清点页面 URL 并与上次的清单对比。
入口优先取 robots.txt 里的 Sitemap:,没有就回退 /sitemap.xml;
sitemap index 会递归展开(最多 20 个文件、2 层),支持 .gz 压缩包。
清单存到 DATA_DIR/index/<host>.json,下次返回新增 / 变更 / 未变 / 移除的计数与 URL。
Args:
url: 站点根或任意页面 URL(按 host 找 sitemap);也可直接给 sitemap 地址。
include: 只保留 URL 匹配该正则的条目;不传不过滤。
exclude: 排除 URL 匹配该正则的条目;不传不排除。
limit: 本次最多处理多少条 URL(默认 1000,硬上限 5000)。
check_content: True 时对 lastmod 变过的条目回抓正文并比哈希,内容真没变的不算 changed
(单次最多回抓 20 个,避免把站点打穿)。
content_diff: True 时同样回抓正文,但额外与 web_watch 的快照对比并返回
changes(逐 URL 的增删行数与 diff 摘要);快照与 web_watch 共用,
下次单页 web_watch 可直接接续对比。dry_run 时不写快照。
dry_run: True 时只对比、不写入本次清单(便于先预览)。
reset: 丢弃旧清单并重建基线(本次返回 first_seen=true)。
session: 回抓正文时使用的登录态会话名(默认 default)。
deadline_ms: 整次调用的总预算(毫秒),不传表示不限;预算耗尽后不再展开新 sitemap。
proxy: 本次所有请求共用的代理;不传则按代理池分配,未配池时沿用全局配置。
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": "web_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| limit | No | ||
| proxy | No | ||
| reset | No | ||
| dry_run | No | ||
| exclude | No | ||
| include | No | ||
| session | No | default | |
| deadline_ms | No | ||
| content_diff | No | ||
| check_content | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |