web_search
Search keywords to get structured titles, URLs, and snippets; optionally fetch top results' content within a token budget for combined search-and-read workflows.
Instructions
搜索关键词,返回结构化的结果列表(标题 / URL / 摘要),不抓结果页正文。
适合"先找入口再抓正文"的两步流程:本工具负责发现候选 URL,正文仍交给 web_fetch。
传 read=true 时会并发抓取 top_k 条结果的正文并在 token 预算内返回,
一次调用即可完成"搜索 + 阅读";传 read="excerpt" 时只返回与 query 最相关的
段落(更省 token,适合问答型调用)。
Args:
query: 搜索关键词,不能为空。
max_results: 期望返回条数,超出配置上限 search_max_results 时按上限截断。
provider: 搜索后端。duckduckgo=HTML 端点,无需 key(默认,取配置 search_provider);
searxng=自托管实例的 JSON API,需设置 SCRAPE_MCP_SEARCH_SEARXNG_URL;
brave / tavily=商业 API,需分别设置 SCRAPE_MCP_SEARCH_BRAVE_API_KEY /
SCRAPE_MCP_SEARCH_TAVILY_API_KEY。
site: 限定站点,填域名或站内路径;会以 site: 运算符透传给后端,
是否严格限定取决于该后端引擎的支持程度。
time_range: 时间范围,day / week / month / year 之一,按后端映射成各自参数。
engines: SearXNG 的引擎名单(如 ["bing", "startpage"]),仅对 searxng 生效。
fallback: 当前后端失败时是否自动回退到其他已配置的后端;不传取配置
search_fallback(默认开启)。关闭后只请求 provider 指定的后端。
bypass_cache: 跳过并绕过搜索结果缓存,强制现查。
deadline_ms: 整次调用的总预算(毫秒),不传表示不限;回退同样受此预算约束。
proxy: 本次请求使用的代理;不传则按代理池分配,未配池时沿用全局配置。
read: false=不读正文(默认);true=抓整页正文;"excerpt"=只返回与 query
最相关的段落(召回不足时回退整页并标记 excerpt_fallback)。
top_k: read 生效时要读正文的条数,1~10,默认 3。
max_tokens: read 生效时的正文 token 总预算;不传取配置 search_read_max_tokens。
content_format: read=true 时正文形态,markdown(默认)或 text;excerpt 模式固定
在 markdown 上选段(text 输出的片段会去格式)。
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": {
"query": "<query>"
},
"name": "web_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| read | No | ||
| site | No | ||
| proxy | No | ||
| query | Yes | ||
| top_k | No | ||
| engines | No | ||
| fallback | No | ||
| provider | No | ||
| max_tokens | No | ||
| time_range | No | ||
| deadline_ms | No | ||
| max_results | No | ||
| bypass_cache | No | ||
| content_format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |