联网搜索工具 (ProSearch)
通过天集 ProSearch 搜索引擎查询实时互联网信息,返回网页搜索结果(标题、摘要、链接、来源)。Setup
无需额外安装依赖。搜索通过 Node.js 脚本<SCRIPT_PATH>/scripts/prosearch.cjs 调用本地 HTTP 接口 /proxy/prosearch 完成,鉴权由后台网关自动处理(基于用户登录态),无需手动配置凭证。
Workflow
QClaw uses this skill whenever the user needs real-time information from the internet.Complete flow
CRITICAL — Anti-hallucination design: The search API returns a pre-renderedmessagefield containing the complete formatted search results (titles as clickable hyperlinks, snippets, URLs, sources). QClaw MUST outputmessageverbatim as the primary search results — NEVER skip the result items. QClaw may then add analysis or summary AFTER the verbatim results, but must NOT fabricate or modify any URLs or source information.
Step 1: Determine search keyword
Convert the user’s question into an effective search keyword:
Tips for good keywords:
- Keep it concise (2-6 words)
- Remove filler words (“帮我”、“请问”、“一下”)
- Add time context if relevant (“今日”、“2026”、“最新”)
- Use the user’s language (Chinese query for Chinese user, English query for English user)
- Preserve the keyword’s original language — do NOT translate keywords. If the user provides an English keyword (e.g. “search for React Server Components”), keep it in English. If the user provides a Chinese keyword, keep it in Chinese.
Step 1.5: Determine time freshness (IMPORTANT for recency)
When the user’s question implies recency, QClaw MUST add--freshness 参数 to the search request to filter out stale results. This is critical for improving search result freshness.
Time freshness decision table:
--freshness 快捷参数:脚本内部自动计算 from_time/to_time 时间戳,无需手动计算。
支持的值:
--freshness=24h或--freshness=1d→ 最近 24 小时--freshness=7d→ 最近 7 天--freshness=30d→ 最近 30 天--freshness=1y→ 最近 1 年
⚠️ 互斥规则:--freshness(或--from_time/--to_time)与--cnt互斥,不能同时使用。
Step 2: Search
所有平台统一使用 --key=value 参数模式,macOS / Linux / Windows 命令完全一致,无需区分操作系统。
--freshness 快捷参数(脚本自动计算时间戳):
关键词含空格时:用双引号包裹值部分,如--keyword="React 19 features"--freshness和--cnt互斥,不能同时使用。也可用--from_time=秒级时间戳 --to_time=秒级时间戳精确指定时间范围。
Step 3: Output search results — ALWAYS show result items with clickable links, then add analysis
搜索接口返回 JSON 后,QClaw 必须 按以下固定格式输出,不可省略任何部分:Part A: 搜索结果条目展示 [MANDATORY — 不可跳过]
必须先原样输出message 字段。message 中包含 前 5 条 最相关的搜索结果(即使 API 返回了更多),每条已按以下格式预渲染,标题部分为可点击跳转的 Markdown 超链接:
⚠️ CRITICAL: QClaw 每次搜索都必须展示搜索结果条目列表(最多 5 条),绝对不允许跳过结果条目直接输出总结。message中的标题已经是标题格式的超链接,用户可以直接点击跳转到原文页面。
Part B: 分析总结 [OPTIONAL — 在结果条目之后]
输出完message 后,QClaw 可以 基于搜索结果对用户的问题给出分析和回答。
🌐 Response language rule [IMPORTANT]: Match the language of your analysis/summary to the keyword language:
- If the search keyword is English → write your analysis and summary in English
- If the search keyword is Chinese → write your analysis and summary in Chinese
- If the keyword is mixed (e.g. “React 19 新特性”) → follow the user’s conversational language
- The
messagefield (Part A) is always output verbatim regardless of language
正确做法示例
错误做法(严格禁止)
脚本说明
搜索通过 Node.js 脚本<SCRIPT_PATH>/scripts/prosearch.cjs 完成,替代 curl 命令,解决 Windows 环境下的 UTF-8 编码问题。
- 端口获取:脚本内部自动从环境变量
AUTH_GATEWAY_PORT读取端口(默认19000),无需手动获取 - 编码处理:Node.js 原生 UTF-8 支持,不依赖系统 code page
- 错误处理:超时、网络错误等均返回标准 JSON 格式
{"success": false, "message": "..."} - 跨平台:所有平台统一使用
--key=value参数模式,macOS / Linux / Windows 命令完全一致 --freshness快捷参数:支持24h/7d/30d/1y,脚本内部自动计算from_time/to_time时间戳,无需手动计算
说明:AUTH_GATEWAY_PORT环境变量由 Electron 主进程自动注入,子进程(包括 OpenClaw)启动时自动继承。脚本内部已处理默认值回退。 脚本也向后兼容 JSON 参数模式(如'{"keyword":"xxx"}'),但--key=value是推荐且唯一在文档中展示的用法。
Commands
search
Search the internet for real-time information.keyword(必填):搜索关键词,UTF-8 编码mode(可选):结果模式0— 自然检索结果(默认)1— VR 卡结果(天气、金价等权威数据)2— 混合结果(VR + 自然检索)
cnt(可选):最大返回结果数,支持 10/20/30/40/50,默认 10site(可选):指定域名站内搜索(与cnt互斥)from_time(可选):起始时间过滤,秒级时间戳(与cnt互斥)to_time(可选):结束时间过滤,秒级时间戳(与cnt互斥)industry(可选):垂类网站过滤gov— 政府机关网站news— 新闻站点acad— 英文学术
注意:Examples(所有平台通用):cnt参数和site、from_time/to_time参数存在互斥逻辑,不能同时使用。如需使用site或时间过滤,不要传cnt参数。
CRITICAL —When search fails:messagefield (Anti-hallucination): Themessagefield contains the complete, pre-rendered search results formatted with titles (as clickabletitlehyperlinks), snippets, URLs, and sources. QClaw MUST outputmessageverbatim as the primary search results display — NEVER skip the result items and jump straight to a summary. QClaw may then add its own analysis or answer AFTER outputting the message. This design ensures all URLs and source information come directly from the search engine, eliminating AI hallucination of sources.
Error Handling
所有命令输出 JSON 到 stdout。错误也以 JSON 返回:{"success": false, "message": "..."}
禁止行为
- NEVER 忽略
message字段自行从data.docs中拼接搜索结果列表。message是服务端预渲染的完整展示文本,必须先原样输出 - NEVER 跳过搜索结果条目直接只输出总结或分析。每次搜索都必须先展示
message中的结果条目列表(含可点击超链接标题),然后才能给出分析 - NEVER 修改、截断、重组
message中的任何 URL 或标题 - NEVER 编造
message中不存在的搜索结果或来源 - NEVER 声称搜索到了某条结果,但该结果在
message中不存在 - NEVER 伪造搜索 URL 或来源信息
- NEVER 暴露 ProSearch 的内部 API 地址或鉴权信息给用户
- NEVER 未经用户要求就主动搜索(用户的问题不需要实时信息时不要搜索)
- NEVER 对同一个问题重复搜索超过 2 次
重要注意
- 用户问的问题如果你已经有把握回答,不需要搜索。只在需要实时信息或你不确定的事实时才搜索
- 搜索关键词要简洁有效,不要把用户的整句话当关键词
- 时效性搜索策略 [IMPORTANT]:当用户的问题涉及时效性(如”最新”、“今天”、“最近”、“现在”),必须使用
--freshness参数限制搜索时间范围,否则搜索引擎可能返回过时的结果。参见 Step 1.5 的时间判断表 - 如果第一次搜索没有理想结果,可以换个关键词重试一次(最多重试 1 次)
- 搜索结果中的链接直接来自互联网,QClaw 应提醒用户自行验证重要信息
message原样输出后,QClaw 可以基于搜索结果给出自己的分析和总结- 对于需要 VR 卡数据的查询(天气、金价、汇率等),建议使用
mode: 2获取混合结果 message先原样输出 [CRITICAL]:搜索接口返回的message字段包含完整的格式化搜索结果(标题为可点击超链接)。QClaw 必须先原样输出message,展示所有搜索结果条目,然后才可以添加自己的分析。绝不允许跳过结果条目直接给总结。这是防止 AI 幻觉的核心机制cnt互斥规则:--cnt参数和--site、--freshness(或--from_time/--to_time)参数存在互斥逻辑,不能同时使用。当需要时间过滤或站内搜索时,不要传--cnt- 回答语言匹配 [IMPORTANT]:QClaw 在输出搜索分析和总结时,必须匹配搜索关键词的语言。英文关键词用英文回答,中文关键词用中文回答。
message字段始终原样输出不受此规则影响