argo-search 2.13.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +93 -0
- package/README.es.md +30 -8
- package/README.ja.md +30 -8
- package/README.ko.md +30 -8
- package/README.md +511 -596
- package/README.zh.md +975 -0
- package/SKILL.md +1 -1
- package/assets/readme/counts.json +1 -1
- package/backends/domain_profiles.json +90 -6
- package/backends/engine_registry.yaml +222 -32
- package/backends/env_passthrough.txt +2 -0
- package/backends/quota_profiles.json +151 -11
- package/bin/argo +3 -0
- package/config.yaml +50 -4
- package/docs/CHANGELOG.md +45 -0
- package/docs/COMMIT_STANDARD.md +98 -0
- package/docs/ENGINE_CATALOG.md +100 -81
- package/docs/MCP_SETUP.md +1 -1
- package/docs/RELEASE_NOTES_v2.14.0.md +88 -0
- package/docs/RELEASE_NOTES_v2.14.1.md +80 -0
- package/docs/RELEASING.md +52 -0
- package/engines/specs/artic.yaml +11 -1
- package/engines/specs/cleveland.yaml +15 -1
- package/engines/specs/clinicaltrials.yaml +24 -1
- package/engines/specs/cnii.yaml +17 -1
- package/engines/specs/coingecko.yaml +10 -2
- package/engines/specs/dbpedia.yaml +32 -0
- package/engines/specs/deezer.yaml +12 -1
- package/engines/specs/doaj.yaml +14 -1
- package/engines/specs/endoflife.yaml +16 -1
- package/engines/specs/eu_opendata.yaml +11 -1
- package/engines/specs/europeana.yaml +19 -1
- package/engines/specs/feed.yaml +62 -0
- package/engines/specs/figshare.yaml +12 -1
- package/engines/specs/fourget.yaml +23 -0
- package/engines/specs/grep_app.yaml +19 -0
- package/engines/specs/hackernews.yaml +17 -1
- package/engines/specs/hal.yaml +19 -1
- package/engines/specs/hf_datasets.yaml +59 -0
- package/engines/specs/hf_papers.yaml +42 -0
- package/engines/specs/jikan.yaml +12 -10
- package/engines/specs/kaggle.yaml +46 -0
- package/engines/specs/local_baidu.yaml +5 -0
- package/engines/specs/local_seek.yaml +34 -0
- package/engines/specs/local_yandex.yaml +37 -0
- package/engines/specs/maven.yaml +61 -0
- package/engines/specs/mojeek.yaml +31 -0
- package/engines/specs/mwmbl.yaml +39 -0
- package/engines/specs/nasa_cmr.yaml +12 -1
- package/engines/specs/nuget.yaml +57 -0
- package/engines/specs/openaire.yaml +34 -0
- package/engines/specs/repology.yaml +18 -0
- package/engines/specs/tatoeba.yaml +14 -1
- package/engines/specs/tvmaze.yaml +5 -1
- package/engines/specs/usda.yaml +14 -1
- package/package.json +14 -10
- package/packages/dsh-plugin/dsh/client.js +1 -0
- package/packages/dsh-plugin/dsh/native-tools.mjs +85 -116
- package/packages/dsh-plugin/dsh/runner.js +35 -1
- package/packages/dsh-plugin/dsh/specs.js +3 -1
- package/packages/dsh-plugin/dsh/wide-research.js +5 -3
- package/packages/dsh-plugin/package.json +1 -1
- package/packages/dsh-plugin/test/client.test.js +6 -0
- package/packages/dsh-plugin/test/config.test.js +5 -1
- package/packages/dsh-plugin/test/index.test.js +3 -1
- package/packages/dsh-plugin/test/size-gate.test.js +2 -2
- package/scripts/badcase_causes.py +81 -0
- package/scripts/badcase_ledger.py +336 -19
- package/scripts/build_release_assets.sh +43 -15
- package/scripts/cache.py +3 -3
- package/scripts/check_commit_report.py +168 -0
- package/scripts/dormant_ledger.py +225 -0
- package/scripts/engine_admission.py +9 -5
- package/scripts/engine_families.py +13 -2
- package/scripts/engine_policy.py +1 -1
- package/scripts/engine_states.py +398 -8
- package/scripts/engine_status.py +31 -0
- package/scripts/engine_validate.py +224 -40
- package/scripts/engines.py +4 -34
- package/scripts/engines_base.py +53 -147
- package/scripts/engines_builders.py +2 -33
- package/scripts/engines_builders_batch12.py +168 -0
- package/scripts/engines_builders_batch16.py +13 -0
- package/scripts/engines_builders_batch9.py +0 -204
- package/scripts/engines_builders_feeds.py +148 -30
- package/scripts/engines_builders_intl.py +0 -328
- package/scripts/engines_builders_science.py +0 -85
- package/scripts/engines_builders_tech.py +0 -98
- package/scripts/engines_parsers.py +924 -0
- package/scripts/evidence_loop.py +91 -4
- package/scripts/fetch_browser.py +4 -2
- package/scripts/fetch_jsrun.py +2 -1
- package/scripts/fetch_v3.py +22 -22
- package/scripts/gen_engine_catalog.py +2 -2
- package/scripts/gen_native_tools.py +46 -18
- package/scripts/local_intent.py +175 -0
- package/scripts/local_seek.py +256 -91
- package/scripts/local_seek_adapter.py +87 -0
- package/scripts/mcp_handlers.py +124 -72
- package/scripts/mcp_server.py +1 -1
- package/scripts/mcp_tools.py +143 -61
- package/scripts/mcp_transport.py +42 -10
- package/scripts/pre-commit +68 -1
- package/scripts/recovery.py +14 -5
- package/scripts/recovery_l0.py +5 -3
- package/scripts/release.py +20 -11
- package/scripts/release_check.py +1 -1
- package/scripts/research.py +1 -1
- package/scripts/research_gates.py +3 -3
- package/scripts/route_lang.py +6 -1
- package/scripts/route_policy.py +26 -14
- package/scripts/search.py +33 -25
- package/scripts/search_cli.py +52 -6
- package/scripts/search_output.py +83 -16
- package/scripts/secret_guard.py +106 -0
- package/scripts/semantic_evidence.py +230 -15
- package/scripts/settings_page.py +80 -8
- package/scripts/source_audit.py +408 -0
- package/scripts/sync_backends.py +38 -1
- package/scripts/wechat_article.py +5 -3
- package/scripts/wide_research.py +4 -1
- package/scripts/x_article_fetch.py +2 -1
- package/sub-skills/local-search/parsers.py +6 -1
- package/sub-skills/local-seek/scripts/seek.py +390 -24
- package/sub-skills/local-seek/scripts/seek_fts.py +28 -9
- package/sub-skills/local-seek/scripts/seek_rank.py +64 -1
- package/README.en.md +0 -814
- package/engines/specs/cinii.yaml +0 -44
- package/scripts/image_vision/vision_probe +0 -0
package/scripts/mcp_handlers.py
CHANGED
|
@@ -99,6 +99,21 @@ def _err_is(message: str) -> dict[str, Any]:
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
def _ok(payload: Any, pretty: bool = False) -> dict[str, Any]:
|
|
102
|
+
"""所有 MCP 工具返回的唯一出口。
|
|
103
|
+
|
|
104
|
+
脱敏必须挂在这里,不能挂在各工具分支:分支有 19 个,漏一个就是一条
|
|
105
|
+
「凭据经 MCP 反射给 Agent 与 LLM」的通道,而漏了不会有任何信号。
|
|
106
|
+
入口处的 CLI 侧(search_cli)另有一处,是历史形态,不是本函数的理由。
|
|
107
|
+
|
|
108
|
+
代价实测(2026-11-11,本机):get_active_secrets 0.07ms/次 +
|
|
109
|
+
redact_data(5 条结果) 0.43ms/次,相对搜索本身 78~82ms 是 0.6%,
|
|
110
|
+
相对深度研究分钟级是零头。
|
|
111
|
+
"""
|
|
112
|
+
try:
|
|
113
|
+
from secret_guard import redact_data
|
|
114
|
+
payload = redact_data(payload)
|
|
115
|
+
except Exception:
|
|
116
|
+
pass
|
|
102
117
|
return {"content": [{"type": "text", "text": _dumps(payload, pretty=pretty)}]}
|
|
103
118
|
|
|
104
119
|
|
|
@@ -194,7 +209,81 @@ def execute_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
194
209
|
"isError": True,
|
|
195
210
|
}
|
|
196
211
|
|
|
212
|
+
# 兼容旧工具调用的软别名映射(向后兼容):
|
|
213
|
+
if name == "argo_social_search":
|
|
214
|
+
args = dict(arguments)
|
|
215
|
+
args["domain"] = "social"
|
|
216
|
+
return execute_tool("argo_search", args)
|
|
217
|
+
elif name == "argo_job":
|
|
218
|
+
args = dict(arguments)
|
|
219
|
+
args["domain"] = "job"
|
|
220
|
+
return execute_tool("argo_search", args)
|
|
221
|
+
elif name == "argo_pdf":
|
|
222
|
+
args = dict(arguments)
|
|
223
|
+
args["mode"] = "pdf"
|
|
224
|
+
return execute_tool("argo_fetch", args)
|
|
225
|
+
elif name == "argo_article":
|
|
226
|
+
args = dict(arguments)
|
|
227
|
+
args["mode"] = "article"
|
|
228
|
+
return execute_tool("argo_fetch", args)
|
|
229
|
+
|
|
197
230
|
if name == "argo_search":
|
|
231
|
+
domain = arguments.get("domain", "web")
|
|
232
|
+
if domain == "social":
|
|
233
|
+
# 旧工具名 argo_social_search 的专属参数在这里仍要认(软别名
|
|
234
|
+
# 只补了 domain,platforms/mode/max_results 原样进来):
|
|
235
|
+
# platforms → 平台名单(默认 hackernews,zhihu,bilibili)
|
|
236
|
+
# mode → text | sentiment(旧名直接给值,不叫 social-sentiment)
|
|
237
|
+
# max_results→ 每平台条数(旧名 num 也认)
|
|
238
|
+
# 漏读任何一个,旧调用方的参数都会静默退化成默认值——调用成功、
|
|
239
|
+
# 结果不是他要的那批,没有任何信号。
|
|
240
|
+
platforms_str = arguments.get("platforms", "hackernews,zhihu,bilibili")
|
|
241
|
+
platforms = [p.strip() for p in platforms_str.split(",") if p.strip()]
|
|
242
|
+
query = arguments["query"]
|
|
243
|
+
n = _clamp_int(
|
|
244
|
+
arguments.get("max_results", arguments.get("num", 5)), 5, 1, 20)
|
|
245
|
+
platform_results, engines_used, errors = _search_social_platforms(platforms, query, n)
|
|
246
|
+
if str(arguments.get("mode", "text")).strip().lower() in (
|
|
247
|
+
"sentiment", "social-sentiment"):
|
|
248
|
+
research_mod = _lazy_cached("research")
|
|
249
|
+
output = research_mod.aggregate_social_sentiment(
|
|
250
|
+
query=query, platforms=platforms, platform_results=platform_results,
|
|
251
|
+
)
|
|
252
|
+
else:
|
|
253
|
+
all_results: list = []
|
|
254
|
+
for p in platforms:
|
|
255
|
+
all_results.extend(platform_results.get(p) or [])
|
|
256
|
+
output = {
|
|
257
|
+
"query": query,
|
|
258
|
+
"platforms": platforms,
|
|
259
|
+
"results": all_results,
|
|
260
|
+
"count": len(all_results),
|
|
261
|
+
"engines_used": engines_used,
|
|
262
|
+
}
|
|
263
|
+
if errors:
|
|
264
|
+
output["errors"] = errors
|
|
265
|
+
return _ok(output, pretty=pretty)
|
|
266
|
+
elif domain == "job":
|
|
267
|
+
job_mod = _lazy_cached("job")
|
|
268
|
+
try:
|
|
269
|
+
out = job_mod.search(
|
|
270
|
+
arguments["query"],
|
|
271
|
+
city=arguments.get("city", ""),
|
|
272
|
+
num=_clamp_int(arguments.get("max_results", arguments.get("num", 5)), 5, 1, 20),
|
|
273
|
+
platforms=arguments.get("platforms", ""),
|
|
274
|
+
loose=bool(arguments.get("loose", False)),
|
|
275
|
+
fetch_n=_clamp_int(arguments.get("fetch_detail", 0), 0, 0, 10),
|
|
276
|
+
)
|
|
277
|
+
except ValueError as e:
|
|
278
|
+
return {"content": [{"type": "text", "text": _dumps({"error": str(e)})}],
|
|
279
|
+
"isError": True}
|
|
280
|
+
return _ok(out, pretty=pretty)
|
|
281
|
+
elif domain == "local":
|
|
282
|
+
return handle_local_search(
|
|
283
|
+
arguments, pretty=pretty, ok_fn=_ok,
|
|
284
|
+
clamp_int_fn=_clamp_int, lazy_cached_fn=_lazy_cached,
|
|
285
|
+
)
|
|
286
|
+
|
|
198
287
|
search_mod = _lazy_cached("search")
|
|
199
288
|
result = search_mod.super_search(
|
|
200
289
|
query=arguments["query"],
|
|
@@ -282,32 +371,6 @@ def execute_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
282
371
|
payload = result
|
|
283
372
|
return _ok(payload, pretty=pretty)
|
|
284
373
|
|
|
285
|
-
elif name == "argo_social_search":
|
|
286
|
-
platforms_str = arguments.get("platforms", "hackernews,zhihu,bilibili")
|
|
287
|
-
platforms = [p.strip() for p in platforms_str.split(",") if p.strip()]
|
|
288
|
-
query = arguments["query"]
|
|
289
|
-
n = _clamp_int(arguments.get("max_results", 5), 5, 1, 20)
|
|
290
|
-
platform_results, engines_used, errors = _search_social_platforms(platforms, query, n)
|
|
291
|
-
if arguments.get("mode", "text") == "sentiment":
|
|
292
|
-
research_mod = _lazy_cached("research")
|
|
293
|
-
output = research_mod.aggregate_social_sentiment(
|
|
294
|
-
query=query, platforms=platforms, platform_results=platform_results,
|
|
295
|
-
)
|
|
296
|
-
else:
|
|
297
|
-
all_results: list = []
|
|
298
|
-
for p in platforms:
|
|
299
|
-
all_results.extend(platform_results.get(p) or [])
|
|
300
|
-
output = {
|
|
301
|
-
"query": query,
|
|
302
|
-
"platforms": platforms,
|
|
303
|
-
"results": all_results,
|
|
304
|
-
"count": len(all_results),
|
|
305
|
-
"engines_used": engines_used,
|
|
306
|
-
}
|
|
307
|
-
if errors:
|
|
308
|
-
output["errors"] = errors
|
|
309
|
-
return _ok(output, pretty=pretty)
|
|
310
|
-
|
|
311
374
|
elif name == "argo_evidence":
|
|
312
375
|
results_json_str = arguments.get("results_json", "")
|
|
313
376
|
if not results_json_str or not results_json_str.strip():
|
|
@@ -347,13 +410,45 @@ def execute_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
347
410
|
return _ok(result, pretty=pretty)
|
|
348
411
|
|
|
349
412
|
elif name == "argo_fetch":
|
|
350
|
-
|
|
413
|
+
url = arguments["url"]
|
|
414
|
+
mode = arguments.get("mode", "text")
|
|
415
|
+
|
|
416
|
+
# 微信公众号文章原生自适应
|
|
417
|
+
if "mp.weixin.qq.com" in url or mode == "article":
|
|
418
|
+
article_mod = _lazy_cached("article")
|
|
419
|
+
try:
|
|
420
|
+
out = article_mod.fetch_article(
|
|
421
|
+
url,
|
|
422
|
+
timeout=_env_int("ARGO_MCP_TIMEOUT_FETCH",
|
|
423
|
+
_int_param(arguments, "timeout", 30)),
|
|
424
|
+
)
|
|
425
|
+
except ValueError as e:
|
|
426
|
+
return {"content": [{"type": "text", "text": _dumps({"error": str(e)})}],
|
|
427
|
+
"isError": True}
|
|
428
|
+
if out.get("ok"):
|
|
429
|
+
max_c = _int_param(arguments, "max_chars", 20000)
|
|
430
|
+
if len(out.get("content", "")) > max_c:
|
|
431
|
+
out["content"] = out["content"][:max_c]
|
|
432
|
+
out["truncated"] = True
|
|
433
|
+
return _ok(out, pretty=pretty)
|
|
434
|
+
|
|
435
|
+
# PDF 文档原生自适应
|
|
436
|
+
if url.lower().endswith(".pdf") or ".pdf?" in url.lower() or mode == "pdf":
|
|
437
|
+
pdf_mod = _lazy_cached("pdf_extract")
|
|
438
|
+
result = pdf_mod.extract_pdf(
|
|
439
|
+
url_or_path=url,
|
|
440
|
+
pages=arguments.get("pages"),
|
|
441
|
+
password=arguments.get("password"),
|
|
442
|
+
)
|
|
443
|
+
return _ok(result, pretty=pretty)
|
|
444
|
+
|
|
445
|
+
if mode == "extract":
|
|
351
446
|
extract_mod = _lazy_cached("extract")
|
|
352
447
|
fetch_mod = _lazy_cached("fetch_v3")
|
|
353
448
|
emode = arguments.get("extract_mode", "all")
|
|
354
449
|
max_chars = _clamp_int(_int_param(arguments, "max_chars", 8000), 8000, 500, 50000)
|
|
355
450
|
fetch_result = fetch_mod.fetch_page_v3(
|
|
356
|
-
|
|
451
|
+
url, max_chars=max_chars,
|
|
357
452
|
timeout=_env_int("ARGO_MCP_TIMEOUT_FETCH",
|
|
358
453
|
_int_param(arguments, "timeout", 15)), raw=True)
|
|
359
454
|
if not fetch_result["success"]:
|
|
@@ -375,7 +470,7 @@ def execute_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
375
470
|
focus_query = arguments.get("focus")
|
|
376
471
|
fetch_v3_mod = _lazy_cached("fetch_v3")
|
|
377
472
|
result = fetch_v3_mod.fetch_v3(
|
|
378
|
-
url=
|
|
473
|
+
url=url,
|
|
379
474
|
max_chars=fetch_v3_mod._focus_fetch_chars(
|
|
380
475
|
_int_param(arguments, "max_chars", 8000), focus_query),
|
|
381
476
|
timeout=_env_int("ARGO_MCP_TIMEOUT_FETCH", _int_param(arguments, "timeout", 15)),
|
|
@@ -422,49 +517,6 @@ def execute_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
422
517
|
"isError": True,
|
|
423
518
|
}
|
|
424
519
|
|
|
425
|
-
elif name == "argo_pdf":
|
|
426
|
-
pdf_mod = _lazy_cached("pdf_extract")
|
|
427
|
-
result = pdf_mod.extract_pdf(
|
|
428
|
-
url_or_path=arguments["url"],
|
|
429
|
-
pages=arguments.get("pages"),
|
|
430
|
-
password=arguments.get("password"),
|
|
431
|
-
)
|
|
432
|
-
return _ok(result, pretty=pretty)
|
|
433
|
-
|
|
434
|
-
elif name == "argo_article":
|
|
435
|
-
article_mod = _lazy_cached("article")
|
|
436
|
-
try:
|
|
437
|
-
out = article_mod.fetch_article(
|
|
438
|
-
arguments["url"],
|
|
439
|
-
timeout=_env_int("ARGO_MCP_TIMEOUT_FETCH",
|
|
440
|
-
_int_param(arguments, "timeout", 30)),
|
|
441
|
-
)
|
|
442
|
-
except ValueError as e:
|
|
443
|
-
return {"content": [{"type": "text", "text": _dumps({"error": str(e)})}],
|
|
444
|
-
"isError": True}
|
|
445
|
-
if out.get("ok"):
|
|
446
|
-
max_c = _int_param(arguments, "max_chars", 20000)
|
|
447
|
-
if len(out.get("content", "")) > max_c:
|
|
448
|
-
out["content"] = out["content"][:max_c]
|
|
449
|
-
out["truncated"] = True
|
|
450
|
-
return _ok(out, pretty=pretty)
|
|
451
|
-
|
|
452
|
-
elif name == "argo_job":
|
|
453
|
-
job_mod = _lazy_cached("job")
|
|
454
|
-
try:
|
|
455
|
-
out = job_mod.search(
|
|
456
|
-
arguments["query"],
|
|
457
|
-
city=arguments.get("city", ""),
|
|
458
|
-
num=_clamp_int(arguments.get("num", 5), 5, 1, 20),
|
|
459
|
-
platforms=arguments.get("platforms", ""),
|
|
460
|
-
loose=bool(arguments.get("loose", False)),
|
|
461
|
-
fetch_n=_clamp_int(arguments.get("fetch_detail", 0), 0, 0, 10),
|
|
462
|
-
)
|
|
463
|
-
except ValueError as e:
|
|
464
|
-
return {"content": [{"type": "text", "text": _dumps({"error": str(e)})}],
|
|
465
|
-
"isError": True}
|
|
466
|
-
return _ok(out, pretty=pretty)
|
|
467
|
-
|
|
468
520
|
surface = _lazy_cached("mcp_handlers_surface")
|
|
469
521
|
surface_result = surface.handle_surface_tool(name, arguments, pretty=pretty)
|
|
470
522
|
if surface_result is not None:
|
package/scripts/mcp_server.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
mcp_server.py — Argo MCP 服务入口(P2-4 拆分后为聚合薄壳)
|
|
4
4
|
|
|
5
5
|
原 970 行单文件已拆为三模块,本文件只做聚合与兼容导出:
|
|
6
|
-
mcp_tools.py 工具 schema 唯一来源(
|
|
6
|
+
mcp_tools.py 工具 schema 唯一来源(19 个工具;tools/list 默认 CORE 4 个)
|
|
7
7
|
mcp_handlers.py 路径引导 + 延迟导入 + 结果压缩 + execute_tool + 预热
|
|
8
8
|
mcp_transport.py JSON-RPC 分发(handle_rpc)+ stdio 帧协议(run_stdio)
|
|
9
9
|
|
package/scripts/mcp_tools.py
CHANGED
|
@@ -5,15 +5,23 @@
|
|
|
5
5
|
extract/preflight/answer/watch/cite 补齐);mcp_transport 的 tools/list 与
|
|
6
6
|
mcp_server 的兼容导出均从本模块取。改 schema 只动这一个文件。
|
|
7
7
|
|
|
8
|
-
tools/list 默认只注入 CORE
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
tools/list 默认只注入 CORE 4 个正交集(search/fetch/research/screenshot,
|
|
9
|
+
约 5KB/轮);全量设 ARGO_MCP_TOOLS=all。execute_tool / --call / DSH 原生规格
|
|
10
|
+
仍吃全量 TOOLS,能力不删。未知名单不回退成全量(同类:过滤失败吐全量)。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
CORE 集合的变更必须同步四处(少一处就有一处文案在骗人):本文件的
|
|
13
|
+
CORE_TOOL_NAMES、mcp_transport 的 initialize instructions、
|
|
14
|
+
references/operations.md 的工具清单节、docs/MCP_SETUP.md 的状态行。
|
|
15
|
+
机械对拍见 tests/test_mcp_consolidated_tools.py::test_instructions_matches_core。
|
|
16
|
+
|
|
17
|
+
schema 设计原则(质量第一,token 第二,严格兼容):
|
|
13
18
|
- 工具 description:第一句「做什么」,第二句「何时用 / 关键注意」。
|
|
14
19
|
删除内部实现机制(引擎数、TF-IDF/RRF、协议文件引用)——模型不靠这些决策。
|
|
15
|
-
- 参数 description:语义 +
|
|
16
|
-
|
|
20
|
+
- 参数 description:语义 + 何时用 + 默认值与范围(如需)。
|
|
21
|
+
第一性原理与奥卡姆剃刀(issue #46):MaaS / OpenAI 严格网关会拦截 JSON Schema
|
|
22
|
+
中的 default、minimum、maximum、minItems 等非标注解(报 400 The request is invalid)。
|
|
23
|
+
因此默认值与范围一律在 description 明确说明,schema 只保留最纯粹的
|
|
24
|
+
type / description / enum / properties / required / items。
|
|
17
25
|
- 调试/运行配置(pretty / skip_cache / timeout)不暴露给模型:
|
|
18
26
|
这些不是模型决策输入,由 server 层环境变量接管(见 mcp_handlers.execute_tool:
|
|
19
27
|
ARGO_MCP_PRETTY / ARGO_MCP_SKIP_CACHE / ARGO_MCP_TIMEOUT[_CRAWL|_FETCH])。
|
|
@@ -22,30 +30,104 @@ schema 设计原则(质量第一,token 第二):
|
|
|
22
30
|
|
|
23
31
|
from __future__ import annotations
|
|
24
32
|
|
|
33
|
+
import copy
|
|
25
34
|
import os
|
|
35
|
+
from typing import Any
|
|
36
|
+
|
|
37
|
+
# 日常高频与核心闭环工具(极简 3+1 正交集:Search 统一检索、Fetch 统一抓取/解析、Research 深度取证、Screenshot 视觉快照)
|
|
38
|
+
CORE_TOOL_NAMES = ("argo_search", "argo_fetch", "argo_research", "argo_screenshot")
|
|
39
|
+
|
|
40
|
+
# MaaS / OpenAI Function Calling 严格网关禁止的校验与注解键(见 issue #46:
|
|
41
|
+
# 火山引擎方舟/腾讯云 MaaS 等严格网关遇到即报 400 The request is invalid)。
|
|
42
|
+
FORBIDDEN_SCHEMA_KEYS = frozenset({
|
|
43
|
+
"default",
|
|
44
|
+
"minimum",
|
|
45
|
+
"maximum",
|
|
46
|
+
"exclusiveMinimum",
|
|
47
|
+
"exclusiveMaximum",
|
|
48
|
+
"minItems",
|
|
49
|
+
"maxItems",
|
|
50
|
+
"minLength",
|
|
51
|
+
"maxLength",
|
|
52
|
+
"pattern",
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def sanitize_schema(schema: dict[str, Any]) -> dict[str, Any]:
|
|
57
|
+
"""将 JSON Schema 净化为严格兼容 OpenAI / MaaS 网关的标准形式。
|
|
58
|
+
|
|
59
|
+
第一性原理与奥卡姆剃刀:
|
|
60
|
+
网关是白名单式语法解析器,非标注解(default/minimum/maximum/minItems 等)
|
|
61
|
+
会被严格网关直接判 400 阻断(issue #46)。模型阅读参数语义依赖
|
|
62
|
+
description 与 enum,默认值与范围已内嵌于 description 中,后端
|
|
63
|
+
执行层(mcp_handlers)自带默认值与 _clamp_int 兜底。
|
|
64
|
+
|
|
65
|
+
本函数做纯函数递归净化:
|
|
66
|
+
1. 剥离 FORBIDDEN_SCHEMA_KEYS 中所有非核心校验注解;
|
|
67
|
+
2. 若 type == 'object',确保 properties 为 dict、required 为 list
|
|
68
|
+
(无必填项时显式补齐 required: [],防止网关报缺少字段);
|
|
69
|
+
3. 递归清洗 properties 内每个字段及 items 结构。
|
|
70
|
+
|
|
71
|
+
**必须挂在 tools/list 出口**(mcp_transport.handle_rpc):只在源头写干净
|
|
72
|
+
schema 是「现在没问题」,挂上净化是「以后有人加回 default 也不会打到
|
|
73
|
+
严格网关」。本函数曾只被自己的测试调用——宣称修了 MaaS 兼容,实际是
|
|
74
|
+
一个没人调用的纯函数(2026-11-11 审计)。接线检查见
|
|
75
|
+
tests/test_mcp_schema_maas_compliance.py::test_sanitize_schema_is_wired。
|
|
76
|
+
"""
|
|
77
|
+
if not isinstance(schema, dict):
|
|
78
|
+
return schema
|
|
79
|
+
out: dict[str, Any] = {}
|
|
80
|
+
for k, v in schema.items():
|
|
81
|
+
if k in FORBIDDEN_SCHEMA_KEYS:
|
|
82
|
+
continue
|
|
83
|
+
if k == "properties" and isinstance(v, dict):
|
|
84
|
+
out[k] = {pk: sanitize_schema(pv) for pk, pv in v.items()}
|
|
85
|
+
elif k == "items" and isinstance(v, dict):
|
|
86
|
+
out[k] = sanitize_schema(v)
|
|
87
|
+
else:
|
|
88
|
+
out[k] = v
|
|
89
|
+
if out.get("type") == "object":
|
|
90
|
+
if "properties" not in out:
|
|
91
|
+
out["properties"] = {}
|
|
92
|
+
if "required" not in out:
|
|
93
|
+
out["required"] = []
|
|
94
|
+
return out
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def sanitize_tool(tool: dict[str, Any]) -> dict[str, Any]:
|
|
98
|
+
"""单个工具的净化出口:只动 inputSchema,其余键原样。
|
|
99
|
+
|
|
100
|
+
单独成函数是为了让「接线」在 tools/list 里是一行可读的调用,而不是一段
|
|
101
|
+
内联的字典推导——内联形态下「有没有真的净化」要靠读代码判断。
|
|
102
|
+
"""
|
|
103
|
+
if not isinstance(tool, dict):
|
|
104
|
+
return tool
|
|
105
|
+
schema = tool.get("inputSchema")
|
|
106
|
+
if not isinstance(schema, dict):
|
|
107
|
+
return tool
|
|
108
|
+
return {**tool, "inputSchema": sanitize_schema(schema)}
|
|
26
109
|
|
|
27
|
-
# 日常 90% 调用只需要这 3 个;顺序即 tools/list 默认顺序。
|
|
28
|
-
CORE_TOOL_NAMES = ("argo_search", "argo_fetch", "argo_local_search")
|
|
29
110
|
|
|
30
111
|
TOOLS = [
|
|
31
112
|
{
|
|
32
113
|
"name": "argo_search",
|
|
33
|
-
"description": "
|
|
114
|
+
"description": "统一搜索(网络/社交/招聘/本地):多引擎融合、支持时间过滤与域名过滤。默认网络搜索;按 domain 可切换社交 UGC、岗位招聘或本机文件。查资料、找答案、找人找帖的首选工具。",
|
|
34
115
|
"inputSchema": {
|
|
35
116
|
"type": "object",
|
|
36
117
|
"properties": {
|
|
37
118
|
"query": {"type": "string", "description": "搜索查询词"},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
119
|
+
"domain": {"type": "string", "enum": ["web", "social", "job", "local"], "description": "搜索领域:web 统一网络搜索(默认),social 社交媒体/论坛讨论,job 招聘岗位聚合,local 本机文件搜索"},
|
|
120
|
+
"engine": {"type": "string", "description": "指定搜索引擎(auto 自动选择;可选 octen/anysearch/exa/zhihu/eastmoney/arxiv/byted/bocha/tavily/deepseek_search/github/wikipedia/semantic_scholar/local_search 等,默认 auto;deepseek_search 为按次计费的官方 DeepSeek 搜索,结果带权威分级与发布时间,新闻时事类查询优先考虑)"},
|
|
121
|
+
"max_results": {"type": "integer", "description": "返回结果条数(1-20,默认 5)"},
|
|
122
|
+
"depth": {"type": "string", "enum": ["fast", "balanced", "deep"], "description": "搜索深度:fast 快、deep 全(慢),默认 fast"},
|
|
123
|
+
"mode": {"type": "string", "enum": ["fast", "auto", "deep", "budget", "sentiment"], "description": "预算模式:fast=免费优先, auto=成本感知, deep=质量优先, budget=配额控制,默认 auto;仅 domain=social 时可写 sentiment(舆情聚合),其余 domain 不认"},
|
|
42
124
|
"since": {"type": "string", "description": "发布时间下限,如 7d / 2026-08-01"},
|
|
43
125
|
"until": {"type": "string", "description": "发布时间上限,如 7d / 2026-08-01"},
|
|
44
|
-
"sort": {"type": "string", "enum": ["relevance", "oldest", "newest"], "description": "排序:relevance=相关度, oldest=最早在前, newest
|
|
45
|
-
"include_domains": {"type": "array", "items": {"type": "string"}, "description": "仅保留这些域名(含子域),如 [\"github.com\"]"
|
|
46
|
-
"exclude_domains": {"type": "array", "items": {"type": "string"}, "description": "排除这些域名(含子域),如 [\"pinterest.com\"]"
|
|
47
|
-
"include_local": {"type": "boolean", "description": "并入本机文件命中(seek 结果尾部,source=local_files,不参与融合评分;默认开)"
|
|
48
|
-
"summary": {"type": "boolean", "description": "精简输出:截断摘要、去掉重字段,省 token"
|
|
126
|
+
"sort": {"type": "string", "enum": ["relevance", "oldest", "newest"], "description": "排序:relevance=相关度, oldest=最早在前, newest=最新在前,默认 relevance"},
|
|
127
|
+
"include_domains": {"type": "array", "items": {"type": "string"}, "description": "仅保留这些域名(含子域),如 [\"github.com\"]"},
|
|
128
|
+
"exclude_domains": {"type": "array", "items": {"type": "string"}, "description": "排除这些域名(含子域),如 [\"pinterest.com\"]"},
|
|
129
|
+
"include_local": {"type": "boolean", "description": "并入本机文件命中(seek 结果尾部,source=local_files,不参与融合评分;默认开)"},
|
|
130
|
+
"summary": {"type": "boolean", "description": "精简输出:截断摘要、去掉重字段,省 token(默认开)"},
|
|
49
131
|
},
|
|
50
132
|
"required": ["query"],
|
|
51
133
|
},
|
|
@@ -57,9 +139,9 @@ TOOLS = [
|
|
|
57
139
|
"type": "object",
|
|
58
140
|
"properties": {
|
|
59
141
|
"query": {"type": "string", "description": "搜索查询词(中文自动扩展召回)"},
|
|
60
|
-
"path": {"type": "string", "description": "
|
|
61
|
-
"max_results": {"type": "integer", "description": "
|
|
62
|
-
"exact": {"type": "boolean", "description": "
|
|
142
|
+
"path": {"type": "string", "description": "搜索目录;缩小范围更快更准(默认 \"~\")"},
|
|
143
|
+
"max_results": {"type": "integer", "description": "返回结果条数(1-20,默认 5)"},
|
|
144
|
+
"exact": {"type": "boolean", "description": "精确匹配,关闭中文扩展(默认关)"},
|
|
63
145
|
},
|
|
64
146
|
"required": ["query"],
|
|
65
147
|
},
|
|
@@ -71,8 +153,8 @@ TOOLS = [
|
|
|
71
153
|
"type": "object",
|
|
72
154
|
"properties": {
|
|
73
155
|
"path": {"type": "string", "description": "文件路径(必须位于白名单目录内)"},
|
|
74
|
-
"max_chars": {"type": "integer", "description": "
|
|
75
|
-
"line_start": {"type": "integer", "description": "起始行号(1 基,可选)"
|
|
156
|
+
"max_chars": {"type": "integer", "description": "预览字符数上限(200-20000,默认 4000)"},
|
|
157
|
+
"line_start": {"type": "integer", "description": "起始行号(1 基,可选)"},
|
|
76
158
|
"line_end": {"type": "integer", "description": "结束行号(可选)"},
|
|
77
159
|
},
|
|
78
160
|
"required": ["path"],
|
|
@@ -86,9 +168,9 @@ TOOLS = [
|
|
|
86
168
|
"properties": {
|
|
87
169
|
"script": {"type": "string", "description": "要运行的计算代码(Python)"},
|
|
88
170
|
"file_inputs": {"type": "string", "description": "白名单输入文件 JSON 数组:[{\"path\":\"...\",\"role\":\"原始数据\"}]"},
|
|
89
|
-
"timeout_s": {"type": "integer", "description": "
|
|
90
|
-
"max_mem_mb": {"type": "integer", "description": "内存上限 MB
|
|
91
|
-
"allow_exec": {"type": "boolean", "description": "是否授权运行(不授权就不执行;未授权时返回 skipped_reason
|
|
171
|
+
"timeout_s": {"type": "integer", "description": "超时秒数(1-120,默认 30)"},
|
|
172
|
+
"max_mem_mb": {"type": "integer", "description": "内存上限 MB(尽力而为,默认 512)"},
|
|
173
|
+
"allow_exec": {"type": "boolean", "description": "是否授权运行(不授权就不执行;未授权时返回 skipped_reason,默认关)"},
|
|
92
174
|
},
|
|
93
175
|
"required": ["script"],
|
|
94
176
|
},
|
|
@@ -101,15 +183,15 @@ TOOLS = [
|
|
|
101
183
|
"properties": {
|
|
102
184
|
"query": {"type": "string", "description": "研究问题(可以是复杂、多步骤的)"},
|
|
103
185
|
"topic": {"type": "string", "description": "选题 profile:ai/investment/finance/academic/tech/tool/internet/social;省略则自动推断"},
|
|
104
|
-
"auto_topic": {"type": "boolean", "description": "无 topic
|
|
105
|
-
"num_sub_queries": {"type": "integer", "description": "
|
|
106
|
-
"max_results": {"type": "integer", "description": "
|
|
107
|
-
"depth": {"type": "string", "enum": ["fast", "balanced", "deep"], "description": "
|
|
108
|
-
"mode": {"type": "string", "enum": ["fast", "auto", "deep", "budget", "social-sentiment"], "description": "预算/模式;社交舆情用 social-sentiment
|
|
186
|
+
"auto_topic": {"type": "boolean", "description": "无 topic 时是否自动推断(默认开)"},
|
|
187
|
+
"num_sub_queries": {"type": "integer", "description": "子查询数量(2-8;有 work_packages 时忽略)"},
|
|
188
|
+
"max_results": {"type": "integer", "description": "每个子查询的结果条数(默认 5)"},
|
|
189
|
+
"depth": {"type": "string", "enum": ["fast", "balanced", "deep"], "description": "搜索深度(默认 balanced)"},
|
|
190
|
+
"mode": {"type": "string", "enum": ["fast", "auto", "deep", "budget", "social-sentiment"], "description": "预算/模式;社交舆情用 social-sentiment,默认 auto"},
|
|
109
191
|
"work_packages": {"type": "string", "description": "工作包 JSON 数组:id, question, query?, file_inputs?(本地一手数据, 白名单制), recompute?({script,budget{timeout_s,max_mem_mb}}), depends_on?。有则跳过扩词,按依赖分阶段取证"},
|
|
110
|
-
"allow_recompute": {"type": "boolean", "description": "授权执行工作包 recompute 计算脚本(不授权就不执行;未授权时 recompute 跳过并触发 recompute_skipped
|
|
192
|
+
"allow_recompute": {"type": "boolean", "description": "授权执行工作包 recompute 计算脚本(不授权就不执行;未授权时 recompute 跳过并触发 recompute_skipped 门禁,默认关)"},
|
|
111
193
|
"platforms": {"type": "string", "description": "social-sentiment 平台列表,逗号分隔"},
|
|
112
|
-
"summary": {"type": "boolean", "description": "精简研究包,省 token"
|
|
194
|
+
"summary": {"type": "boolean", "description": "精简研究包,省 token(默认开)"},
|
|
113
195
|
},
|
|
114
196
|
"required": ["query"],
|
|
115
197
|
},
|
|
@@ -122,7 +204,7 @@ TOOLS = [
|
|
|
122
204
|
"properties": {
|
|
123
205
|
"query": {"type": "string", "description": "搜索查询词(用于交叉验证)"},
|
|
124
206
|
"results_json": {"type": "string", "description": "待评估的搜索结果 JSON(为空时自动搜索)。格式:{\"results\": [{\"title\":\"...\",\"url\":\"...\",\"snippet\":\"...\",\"source\":\"...\",\"score\":0.8}]}"},
|
|
125
|
-
"max_results": {"type": "integer", "description": "
|
|
207
|
+
"max_results": {"type": "integer", "description": "自动搜索时的结果条数(默认 10)"},
|
|
126
208
|
},
|
|
127
209
|
"required": ["query"],
|
|
128
210
|
},
|
|
@@ -145,26 +227,26 @@ TOOLS = [
|
|
|
145
227
|
"type": "object",
|
|
146
228
|
"properties": {
|
|
147
229
|
"url": {"type": "string", "description": "站点根 URL"},
|
|
148
|
-
"strategy": {"type": "string", "enum": ["sitemap", "bfs"], "description": "
|
|
149
|
-
"max_pages": {"type": "integer", "description": "
|
|
150
|
-
"max_depth": {"type": "integer", "description": "BFS
|
|
230
|
+
"strategy": {"type": "string", "enum": ["sitemap", "bfs"], "description": "爬取策略,默认 bfs"},
|
|
231
|
+
"max_pages": {"type": "integer", "description": "最大抓取页数(1-50,默认 10)"},
|
|
232
|
+
"max_depth": {"type": "integer", "description": "BFS 最大深度(1-5,默认 2)"},
|
|
151
233
|
},
|
|
152
234
|
"required": ["url"],
|
|
153
235
|
},
|
|
154
236
|
},
|
|
155
237
|
{
|
|
156
238
|
"name": "argo_fetch",
|
|
157
|
-
"description": "
|
|
239
|
+
"description": "智能页面/长文/PDF抓取:HTTP 优先,遇反爬自动升级反检测浏览器;微信公众号文章(mp.weixin.qq.com)与 PDF 自动感知适配解析;支持 BM25 聚焦提取(focus 省 80%+ token)与结构化提取(mode=extract 抽表格/元数据/JSON-LD)。通读正文与获取文档的首选工具。",
|
|
158
240
|
"inputSchema": {
|
|
159
241
|
"type": "object",
|
|
160
242
|
"properties": {
|
|
161
|
-
"url": {"type": "string", "description": "目标 URL"},
|
|
162
|
-
"mode": {"type": "string", "enum": ["text", "extract"
|
|
163
|
-
"extract_mode": {"type": "string", "enum": ["tables", "metadata", "jsonld", "all"], "description": "mode=extract
|
|
243
|
+
"url": {"type": "string", "description": "目标 URL 或本地 PDF 路径"},
|
|
244
|
+
"mode": {"type": "string", "enum": ["text", "extract", "article", "pdf"], "description": "抓取模式:text=正文/聚焦文本(默认 text), extract=结构化提取, article=公众号全文, pdf=PDF解析。微信与PDF链接自动识别"},
|
|
245
|
+
"extract_mode": {"type": "string", "enum": ["tables", "metadata", "jsonld", "all"], "description": "mode=extract 时的提取子模式,默认 all"},
|
|
164
246
|
"focus": {"type": "string", "description": "BM25 聚焦查询词:只返回相关段落,省 token(仅 mode=text)"},
|
|
165
|
-
"max_chars": {"type": "integer", "description": "
|
|
166
|
-
"use_browser": {"type": "boolean", "description": "强制用反检测浏览器(HTTP
|
|
167
|
-
"include_links": {"type": "boolean", "description": "附带正文内链接(最多 30 条;默认只回 links_count,省 token
|
|
247
|
+
"max_chars": {"type": "integer", "description": "返回正文最大字符数(500-50000,默认 8000)"},
|
|
248
|
+
"use_browser": {"type": "boolean", "description": "强制用反检测浏览器(HTTP 失败时已自动升级,默认关)"},
|
|
249
|
+
"include_links": {"type": "boolean", "description": "附带正文内链接(最多 30 条;默认只回 links_count,省 token,默认关)"},
|
|
168
250
|
},
|
|
169
251
|
"required": ["url"],
|
|
170
252
|
},
|
|
@@ -176,7 +258,7 @@ TOOLS = [
|
|
|
176
258
|
"type": "object",
|
|
177
259
|
"properties": {
|
|
178
260
|
"url": {"type": "string", "description": "目标 URL"},
|
|
179
|
-
"full_page": {"type": "boolean", "description": "
|
|
261
|
+
"full_page": {"type": "boolean", "description": "全页截图(默认仅当前视口,默认关)"},
|
|
180
262
|
"output_path": {"type": "string", "description": "输出路径(默认写入系统临时目录:<temp>/argo_screenshot_<timestamp>.png)"},
|
|
181
263
|
},
|
|
182
264
|
"required": ["url"],
|
|
@@ -202,9 +284,9 @@ TOOLS = [
|
|
|
202
284
|
"type": "object",
|
|
203
285
|
"properties": {
|
|
204
286
|
"query": {"type": "string", "description": "搜索查询词"},
|
|
205
|
-
"mode": {"type": "string", "enum": ["text", "sentiment"], "description": "text=帖子列表, sentiment
|
|
206
|
-
"platforms": {"type": "string", "description": "平台列表,逗号分隔;可选 hackernews,v2ex,zhihu,bilibili,twitter,reddit,xiaohongshu,weibo
|
|
207
|
-
"max_results": {"type": "integer", "description": "
|
|
287
|
+
"mode": {"type": "string", "enum": ["text", "sentiment"], "description": "text=帖子列表, sentiment=舆情聚合分析,默认 text"},
|
|
288
|
+
"platforms": {"type": "string", "description": "平台列表,逗号分隔;可选 hackernews,v2ex,zhihu,bilibili,twitter,reddit,xiaohongshu,weibo,默认 hackernews,zhihu,bilibili"},
|
|
289
|
+
"max_results": {"type": "integer", "description": "每个平台的结果条数(1-20,默认 5)"},
|
|
208
290
|
},
|
|
209
291
|
"required": ["query"],
|
|
210
292
|
},
|
|
@@ -216,7 +298,7 @@ TOOLS = [
|
|
|
216
298
|
"type": "object",
|
|
217
299
|
"properties": {
|
|
218
300
|
"url": {"type": "string", "description": "mp.weixin.qq.com 文章链接"},
|
|
219
|
-
"max_chars": {"type": "integer", "description": "
|
|
301
|
+
"max_chars": {"type": "integer", "description": "返回正文最大字符数(500-50000,默认 20000)"},
|
|
220
302
|
},
|
|
221
303
|
"required": ["url"],
|
|
222
304
|
},
|
|
@@ -229,10 +311,10 @@ TOOLS = [
|
|
|
229
311
|
"properties": {
|
|
230
312
|
"query": {"type": "string", "description": "职位关键词,如:工艺工程师、会计、电工"},
|
|
231
313
|
"city": {"type": "string", "description": "地区:省/市/县或海外城市(成都、昆山、新加坡…),空=不过滤地区"},
|
|
232
|
-
"num": {"type": "integer", "description": "
|
|
233
|
-
"platforms": {"type": "string", "description": "逗号分隔平台: zhipin,liepin,zhaopin,51job,597,jrzp;空=全部"
|
|
234
|
-
"loose": {"type": "boolean", "description": "
|
|
235
|
-
"fetch_detail": {"type": "integer", "description": "对前 N 条高命中结果抓详情页补全结构化字段(0=仅 snippet
|
|
314
|
+
"num": {"type": "integer", "description": "每后端条数(1-20,默认 5)"},
|
|
315
|
+
"platforms": {"type": "string", "description": "逗号分隔平台: zhipin,liepin,zhaopin,51job,597,jrzp;空=全部"},
|
|
316
|
+
"loose": {"type": "boolean", "description": "宽松:异地岗位也保留;默认严格地区过滤(默认关)"},
|
|
317
|
+
"fetch_detail": {"type": "integer", "description": "对前 N 条高命中结果抓详情页补全结构化字段(0=仅 snippet 提取,范围 0-10,默认 0)"},
|
|
236
318
|
},
|
|
237
319
|
"required": ["query"],
|
|
238
320
|
},
|
|
@@ -244,8 +326,8 @@ TOOLS = [
|
|
|
244
326
|
"type": "object",
|
|
245
327
|
"properties": {
|
|
246
328
|
"url": {"type": "string", "description": "目标网页链接"},
|
|
247
|
-
"mode": {"type": "string", "enum": ["tables", "metadata", "jsonld", "all"], "description": "提取内容:tables=HTML表格, metadata=Meta元数据, jsonld=JSON-LD, all
|
|
248
|
-
"max_chars": {"type": "integer", "description": "
|
|
329
|
+
"mode": {"type": "string", "enum": ["tables", "metadata", "jsonld", "all"], "description": "提取内容:tables=HTML表格, metadata=Meta元数据, jsonld=JSON-LD, all=全部,默认 all"},
|
|
330
|
+
"max_chars": {"type": "integer", "description": "抓取页面最大字符数(1000-200000,默认 50000)"},
|
|
249
331
|
},
|
|
250
332
|
"required": ["url"],
|
|
251
333
|
},
|
|
@@ -256,8 +338,8 @@ TOOLS = [
|
|
|
256
338
|
"inputSchema": {
|
|
257
339
|
"type": "object",
|
|
258
340
|
"properties": {
|
|
259
|
-
"urls": {"type": "array", "items": {"type": "string"}, "description": "待预检的 URL 列表"
|
|
260
|
-
"probe": {"type": "boolean", "description": "联网探测存活(404/410
|
|
341
|
+
"urls": {"type": "array", "items": {"type": "string"}, "description": "待预检的 URL 列表"},
|
|
342
|
+
"probe": {"type": "boolean", "description": "联网探测存活(404/410 判死;默认纯本地规则,默认关)"},
|
|
261
343
|
},
|
|
262
344
|
"required": ["urls"],
|
|
263
345
|
},
|
|
@@ -283,7 +365,7 @@ TOOLS = [
|
|
|
283
365
|
"properties": {
|
|
284
366
|
"action": {"type": "string", "enum": ["add", "check", "list", "remove"], "description": "add=登记快照, check=复查变化(可指定单个 url), list=看清单, remove=取消关注"},
|
|
285
367
|
"url": {"type": "string", "description": "目标页面(add/remove 必填;check 可选=只查这一条)"},
|
|
286
|
-
"note": {"type": "string", "description": "备注(add
|
|
368
|
+
"note": {"type": "string", "description": "备注(add 可选,默认空)"},
|
|
287
369
|
},
|
|
288
370
|
"required": ["action"],
|
|
289
371
|
},
|
|
@@ -294,8 +376,8 @@ TOOLS = [
|
|
|
294
376
|
"inputSchema": {
|
|
295
377
|
"type": "object",
|
|
296
378
|
"properties": {
|
|
297
|
-
"dois": {"type": "array", "items": {"type": "string"}, "description": "DOI 列表,如 [\"10.1038/s41586-024-0001-x\"]"
|
|
298
|
-
"style": {"type": "string", "enum": ["gbt7714", "numeric", "apa", "bibtex"], "description": "
|
|
379
|
+
"dois": {"type": "array", "items": {"type": "string"}, "description": "DOI 列表,如 [\"10.1038/s41586-024-0001-x\"]"},
|
|
380
|
+
"style": {"type": "string", "enum": ["gbt7714", "numeric", "apa", "bibtex"], "description": "引用格式,默认 gbt7714"},
|
|
299
381
|
},
|
|
300
382
|
"required": ["dois"],
|
|
301
383
|
},
|
|
@@ -304,7 +386,7 @@ TOOLS = [
|
|
|
304
386
|
|
|
305
387
|
|
|
306
388
|
def listed_tools(spec: str | None = None) -> list[dict]:
|
|
307
|
-
"""tools/list 返回集。默认 CORE
|
|
389
|
+
"""tools/list 返回集。默认 CORE 4 个正交集;all 全量;逗号名单按名取。
|
|
308
390
|
|
|
309
391
|
未知名字忽略,空结果也不回退成全量——曾经「过滤失败吐全量」把 12KB
|
|
310
392
|
schema 砸进每一轮。execute_tool 不受此限制。
|