MCPcopy Create free account
hub / github.com/Qinbf/groundmap / refToToolCall

Function refToToolCall

tools/debug-console/lib/wiki-ref.ts:271–279  ·  view source on GitHub ↗
(ref: WikiRef)

Source from the content-addressed store, hash-verified

269
270/** 根据 ref 决定调哪个 KB 工具 + 工具参数 */
271export function refToToolCall(ref: WikiRef): { tool: string; args: Record<string, unknown> } {
272 if (ref.anchor && ref.isBlock) {
273 return { tool: "read_block", args: { path: ref.path, anchor: ref.anchor } };
274 }
275 if (ref.anchor) {
276 return { tool: "read_section", args: { path: ref.path, anchor: ref.anchor } };
277 }
278 return { tool: "read_page", args: { path: ref.path } };
279}
280
281/** 主管理台 web/ 的页面深链 */
282export function refToAdminUrl(ref: WikiRef, kbBase = "http://localhost:3006"): string {

Callers 1

PreviewPanelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected