tyc-cli 0.2.0 → 0.2.2
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/CHANGELOG.md +1 -1
- package/README.md +4 -4
- package/dist/catalog.json +10 -74
- package/dist/commands/layers.js +6 -6
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
## 📖 项目简介
|
|
13
13
|
|
|
14
14
|
`tyc-cli` 是天眼查 MCP Server 的官方命令行客户端。通过 MCP 协议(JSON-RPC 2.0 over
|
|
15
|
-
Streamable HTTP)调用天眼查
|
|
15
|
+
Streamable HTTP)调用天眼查 163 个业务语义聚合工具,覆盖企业工商、知产、司法风险、
|
|
16
16
|
董监高等全维度商业数据。
|
|
17
17
|
|
|
18
18
|
**核心特点**:
|
|
@@ -22,7 +22,7 @@ Streamable HTTP)调用天眼查 167 个业务语义聚合工具,覆盖企业
|
|
|
22
22
|
- 🔌 **即插即用**:默认连接官方 MCP 端点 `https://ai-mcp.tianyancha.com/mcp`;
|
|
23
23
|
支持 `--url` 指向私有部署
|
|
24
24
|
- 🔄 **Session 复用**:`Mcp-Session-Id` 本地缓存 24 小时,后续调用零 initialize 开销
|
|
25
|
-
- 🎯 **6 大业务分类 /
|
|
25
|
+
- 🎯 **6 大业务分类 / 163 个工具**:企业基础信息 · 风险合规 · 知识产权 · 经营与公示 · 历史信息 · 董监高
|
|
26
26
|
- 🤖 **AI Agent 友好**:tyc 英文 key 透传 / 时间戳格式化 / `_summary / _empty / _warnings` 元数据
|
|
27
27
|
|
|
28
28
|
---
|
|
@@ -119,7 +119,7 @@ tyc executive personnel-dishonest "..." --humanName "张三"
|
|
|
119
119
|
|
|
120
120
|
## 📚 查询指令手册
|
|
121
121
|
|
|
122
|
-
### 企业基础信息(company,
|
|
122
|
+
### 企业基础信息(company,50)
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
125
|
tyc company registration-info "北京百度网讯科技有限公司" # 工商登记
|
|
@@ -298,7 +298,7 @@ tyc-cli/
|
|
|
298
298
|
| 职责 | 命令树 · 参数透传 · 格式化输出 | 多源聚合 · 时间戳格式化 · 元数据注入 · Authorization 透传至 OpenAPI |
|
|
299
299
|
| 运维 | 用户本地安装 | 官方托管 `ai-mcp.tianyancha.com`,或用户自建 |
|
|
300
300
|
|
|
301
|
-
CLI 和 MCP Server 共享同一
|
|
301
|
+
CLI 和 MCP Server 共享同一 163 工具清单;工具元数据从打包内的 `catalog.json`
|
|
302
302
|
读取,保证命令树冷启动零网络开销。
|
|
303
303
|
|
|
304
304
|
---
|
package/dist/catalog.json
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
{
|
|
6
6
|
"group": "company",
|
|
7
7
|
"name_zh": "企业基础信息",
|
|
8
|
-
"tool_count":
|
|
8
|
+
"tool_count": 49
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"group": "risk",
|
|
12
12
|
"name_zh": "风险合规",
|
|
13
|
-
"tool_count":
|
|
13
|
+
"tool_count": 35
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"group": "intellectual_property",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"layer": "L1",
|
|
43
|
-
"count":
|
|
43
|
+
"count": 6
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"layer": "L2",
|
|
47
|
-
"count":
|
|
47
|
+
"count": 57
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"layer": "L3",
|
|
51
|
-
"count":
|
|
51
|
+
"count": 99
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"tools": [
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
{
|
|
200
200
|
"name": "get_company_profile",
|
|
201
201
|
"group": "company",
|
|
202
|
-
"layer": "
|
|
202
|
+
"layer": "L2",
|
|
203
203
|
"cliMethod": "profile",
|
|
204
204
|
"categoryNameZh": "企业基础信息",
|
|
205
205
|
"description": "查询企业的简介信息,包括企业名称、简介,适用于企业画像构建、企业业务分析场景。",
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
{
|
|
232
232
|
"name": "get_company_scale",
|
|
233
233
|
"group": "company",
|
|
234
|
-
"layer": "
|
|
234
|
+
"layer": "L2",
|
|
235
235
|
"cliMethod": "scale",
|
|
236
236
|
"categoryNameZh": "企业基础信息",
|
|
237
237
|
"description": "查询企业规模相关指标,包括人员规模、参保人数、分支机构数量、对外投资数量等。",
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
{
|
|
248
248
|
"name": "get_company_tags",
|
|
249
249
|
"group": "company",
|
|
250
|
-
"layer": "
|
|
250
|
+
"layer": "L2",
|
|
251
251
|
"cliMethod": "tags",
|
|
252
252
|
"categoryNameZh": "企业基础信息",
|
|
253
253
|
"description": "查询企业标签,包括领域分类、主营业务、榜单等标签信息。",
|
|
@@ -292,38 +292,6 @@
|
|
|
292
292
|
}
|
|
293
293
|
]
|
|
294
294
|
},
|
|
295
|
-
{
|
|
296
|
-
"name": "get_enterprise_report_basic",
|
|
297
|
-
"group": "company",
|
|
298
|
-
"layer": "L1",
|
|
299
|
-
"cliMethod": "enterprise-report-basic",
|
|
300
|
-
"categoryNameZh": "企业基础信息",
|
|
301
|
-
"description": "查询企业基础版信用报告,包括工商信息、分支机构、变更记录、主要人员、联系方式等。",
|
|
302
|
-
"params": [
|
|
303
|
-
{
|
|
304
|
-
"name": "searchKey",
|
|
305
|
-
"type": "string",
|
|
306
|
-
"required": true,
|
|
307
|
-
"description": "企业名称 或 统一社会信用代码"
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"name": "get_enterprise_report_professional",
|
|
313
|
-
"group": "company",
|
|
314
|
-
"layer": "L1",
|
|
315
|
-
"cliMethod": "enterprise-report-professional",
|
|
316
|
-
"categoryNameZh": "企业基础信息",
|
|
317
|
-
"description": "查询企业专业版信用报告,包括基础版所有字段 + 司法风险、经营风险、知识产权、经营信息、上市等全维度数据。",
|
|
318
|
-
"params": [
|
|
319
|
-
{
|
|
320
|
-
"name": "searchKey",
|
|
321
|
-
"type": "string",
|
|
322
|
-
"required": true,
|
|
323
|
-
"description": "企业名称 或 统一社会信用代码"
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
295
|
{
|
|
328
296
|
"name": "get_equity_ratio",
|
|
329
297
|
"group": "company",
|
|
@@ -407,7 +375,7 @@
|
|
|
407
375
|
{
|
|
408
376
|
"name": "get_financial_summary",
|
|
409
377
|
"group": "company",
|
|
410
|
-
"layer": "
|
|
378
|
+
"layer": "L2",
|
|
411
379
|
"cliMethod": "financial-summary",
|
|
412
380
|
"categoryNameZh": "企业基础信息",
|
|
413
381
|
"description": "查询上市公司财务简析数据,包括营业收入、净利润、总资产、净资产、净利率、毛利率、资产负债率。",
|
|
@@ -773,22 +741,6 @@
|
|
|
773
741
|
}
|
|
774
742
|
]
|
|
775
743
|
},
|
|
776
|
-
{
|
|
777
|
-
"name": "get_tax_invoice_info",
|
|
778
|
-
"group": "company",
|
|
779
|
-
"layer": "L2",
|
|
780
|
-
"cliMethod": "tax-invoice-info",
|
|
781
|
-
"categoryNameZh": "企业基础信息",
|
|
782
|
-
"description": "查询企业税号开票信息,包括纳税人识别号、企业类型、地址、联系电话、开户行、开户行账号,适用于财务开票场景。",
|
|
783
|
-
"params": [
|
|
784
|
-
{
|
|
785
|
-
"name": "searchKey",
|
|
786
|
-
"type": "string",
|
|
787
|
-
"required": true,
|
|
788
|
-
"description": "企业名称 或 统一社会信用代码"
|
|
789
|
-
}
|
|
790
|
-
]
|
|
791
|
-
},
|
|
792
744
|
{
|
|
793
745
|
"name": "search_companies",
|
|
794
746
|
"group": "company",
|
|
@@ -903,7 +855,7 @@
|
|
|
903
855
|
{
|
|
904
856
|
"name": "verify_company_accuracy",
|
|
905
857
|
"group": "company",
|
|
906
|
-
"layer": "
|
|
858
|
+
"layer": "L2",
|
|
907
859
|
"cliMethod": "accuracy",
|
|
908
860
|
"categoryNameZh": "企业基础信息",
|
|
909
861
|
"description": "核实企业名称、法定代表人与统一社会信用代码的匹配性,适用于企业实名认证、准入资质初审及基础信息准确性校验。",
|
|
@@ -2443,22 +2395,6 @@
|
|
|
2443
2395
|
}
|
|
2444
2396
|
]
|
|
2445
2397
|
},
|
|
2446
|
-
{
|
|
2447
|
-
"name": "get_disciplinary_list",
|
|
2448
|
-
"group": "risk",
|
|
2449
|
-
"layer": "L3",
|
|
2450
|
-
"cliMethod": "disciplinary-list",
|
|
2451
|
-
"categoryNameZh": "风险合规",
|
|
2452
|
-
"description": "查询企业被纳入惩戒/黑名单情况(数据来源:天眼查风险标签聚合)。",
|
|
2453
|
-
"params": [
|
|
2454
|
-
{
|
|
2455
|
-
"name": "searchKey",
|
|
2456
|
-
"type": "string",
|
|
2457
|
-
"required": true,
|
|
2458
|
-
"description": "企业名称 或 统一社会信用代码"
|
|
2459
|
-
}
|
|
2460
|
-
]
|
|
2461
|
-
},
|
|
2462
2398
|
{
|
|
2463
2399
|
"name": "get_dishonest_info",
|
|
2464
2400
|
"group": "risk",
|
package/dist/commands/layers.js
CHANGED
|
@@ -10,9 +10,9 @@ const LAYER_SPECS = [
|
|
|
10
10
|
{
|
|
11
11
|
layer: "L1",
|
|
12
12
|
title: "Overview · 概要层",
|
|
13
|
-
summary: "
|
|
14
|
-
trigger: '"
|
|
15
|
-
contract: "
|
|
13
|
+
summary: "**6 个 facet 队长,每 facet 1 个总览**:company-base / 风险 / 知产 / 经营信用 / 历史 / 董监高 各 1 个 L1 工具,单次调用聚合该 facet 多子维度。",
|
|
14
|
+
trigger: '"这家公司整体怎么样 / 风险如何 / 知产实力 / 经营状况 / 历史变更 / 这个人是谁"',
|
|
15
|
+
contract: "Agent 按 facet 选 1 个 L1 调用即得 _summary + drill_down 线索;不需要你预先在 facet 内挑子维度。",
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
layer: "L2",
|
|
@@ -115,11 +115,11 @@ function renderLayersText() {
|
|
|
115
115
|
const total = getTotalCount();
|
|
116
116
|
const defaultSurface = getLayerCount("L0") + getLayerCount("L1");
|
|
117
117
|
const lines = [];
|
|
118
|
-
lines.push("tyc-cli · Layered Tool Architecture
|
|
118
|
+
lines.push("tyc-cli · Layered Tool Architecture");
|
|
119
119
|
lines.push(`Total ${total} tools · L0=${getLayerCount("L0")} L1=${getLayerCount("L1")} L2=${getLayerCount("L2")} L3=${getLayerCount("L3")}`);
|
|
120
120
|
lines.push("Rationale: LLM tool-selection accuracy collapses beyond 30 tools.");
|
|
121
121
|
lines.push(` tyc carves L0 into a single entity-resolution tool, so the default LLM`);
|
|
122
|
-
lines.push(` surface is L0 + L1 = ${defaultSurface} tools (≤
|
|
122
|
+
lines.push(` surface is L0 + L1 = ${defaultSurface} tools (≤ 15-tool exposure limit);`);
|
|
123
123
|
lines.push(" L2/L3 are discovered on demand via _summary / drill_down_tools.");
|
|
124
124
|
lines.push("");
|
|
125
125
|
for (const s of LAYER_SPECS) {
|
|
@@ -145,7 +145,7 @@ function renderLayersMarkdown() {
|
|
|
145
145
|
lines.push("# tyc-cli · Layered Tool Architecture");
|
|
146
146
|
lines.push("");
|
|
147
147
|
lines.push(`> Total **${getTotalCount()}** tools · **L0=${getLayerCount("L0")}** · **L1=${getLayerCount("L1")}** · **L2=${getLayerCount("L2")}** · **L3=${getLayerCount("L3")}** `);
|
|
148
|
-
lines.push(`> Design rationale
|
|
148
|
+
lines.push(`> Design rationale: LLM tool-selection accuracy collapses above 30 tools; tyc carves L0 into a dedicated entity-resolution tool so the default LLM surface = L0 + L1 = ${defaultSurface} tools (≤ 15-tool limit), discovers L2/L3 on demand.`);
|
|
149
149
|
lines.push("");
|
|
150
150
|
lines.push("| Layer | Tools | Summary | Trigger |");
|
|
151
151
|
lines.push("|---|---:|---|---|");
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getCategories, getLayerCount, getTotalCount, } from "./registry.js";
|
|
|
7
7
|
// 顶层 help:把"最懂 AI 的 CLI"落在 4 层架构 + 调用顺序 + 可发现性上。
|
|
8
8
|
// Agent 看 tyc --help 时应立刻读懂"先 L0 锚定企业,再 L1 概览,再 L2 下钻,最后 L3 详情"这条主线。
|
|
9
9
|
const helpText = `
|
|
10
|
-
ARCHITECTURE — Layered Tool Discovery for LLM Agents
|
|
10
|
+
ARCHITECTURE — Layered Tool Discovery for LLM Agents
|
|
11
11
|
|
|
12
12
|
Cognitive research shows LLM tool-selection accuracy collapses above
|
|
13
13
|
30 tools (>95% at 10, ~70% at 30, <50% at 100+). tyc counters this with
|
|
@@ -15,7 +15,7 @@ ARCHITECTURE — Layered Tool Discovery for LLM Agents (v5 §3.3 ①)
|
|
|
15
15
|
entity-resolution layer:
|
|
16
16
|
|
|
17
17
|
┌─ L0 Resolve ${pad(getLayerCount("L0"), 3)} tool entity resolution · 简称/曾用名/模糊名 → 精确企业
|
|
18
|
-
├─ L1 Overview ${pad(getLayerCount("L1"), 3)} tools
|
|
18
|
+
├─ L1 Overview ${pad(getLayerCount("L1"), 3)} tools one captain per facet · returns _summary + drill_down
|
|
19
19
|
├─ L2 Drill-down ${pad(getLayerCount("L2"), 3)} tools one-hop into a specific data dimension
|
|
20
20
|
└─ L3 Specialized ${pad(getLayerCount("L3"), 3)} tools id-based detail · search_* · vertical SKILLs
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ ARCHITECTURE — Layered Tool Discovery for LLM Agents (v5 §3.3 ①)
|
|
|
34
34
|
Rule of thumb: the smaller the layer number, the higher the information
|
|
35
35
|
density per token. L0 is MANDATORY — skipping it (without a USCC already
|
|
36
36
|
in hand) wastes downstream calls on the wrong entity.
|
|
37
|
-
Default LLM surface = L0 + L1 = ${getLayerCount("L0") + getLayerCount("L1")} tools (≤
|
|
37
|
+
Default LLM surface = L0 + L1 = ${getLayerCount("L0") + getLayerCount("L1")} tools (≤ 15-tool exposure limit).
|
|
38
38
|
|
|
39
39
|
DISCOVER BY LAYER
|
|
40
40
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tyc-cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "天眼查 MCP CLI —
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "天眼查 MCP CLI — 163 个业务语义聚合工具 · 命令行直达企业数据 · 通过 MCP Server 调用",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tyc": "./dist/index.js"
|