@ppdocs/mcp 2.6.13 → 2.6.14
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/dist/tools/index.js +4 -4
- package/package.json +1 -1
package/dist/tools/index.js
CHANGED
|
@@ -118,14 +118,14 @@ export function registerTools(server, projectId, _user) {
|
|
|
118
118
|
return wrap(projectId, node ? JSON.stringify(node, null, 2) : '操作失败');
|
|
119
119
|
});
|
|
120
120
|
// 5. 搜索节点
|
|
121
|
-
server.tool('kg_search', '
|
|
121
|
+
server.tool('kg_search', '关键词搜索节点,按命中率排序返回', {
|
|
122
122
|
keywords: z.array(z.string()).describe('关键词列表(OR逻辑)'),
|
|
123
|
-
limit: z.number().optional().describe('返回数量(默认
|
|
123
|
+
limit: z.number().optional().describe('返回数量(默认10)')
|
|
124
124
|
}, async (args) => {
|
|
125
|
-
const results = await storage.searchNodes(projectId, args.keywords, args.limit);
|
|
125
|
+
const results = await storage.searchNodes(projectId, args.keywords, args.limit || 10);
|
|
126
126
|
const output = results.map(r => ({
|
|
127
127
|
id: r.node.id, title: r.node.title, type: r.node.type,
|
|
128
|
-
status: r.node.status,
|
|
128
|
+
status: r.node.status, hitRate: `${Math.round(r.score)}%`
|
|
129
129
|
}));
|
|
130
130
|
return wrap(projectId, JSON.stringify(output, null, 2));
|
|
131
131
|
});
|