MCPcopy
hub / github.com/xpf0000/FlyEnv / ToolDef

Interface ToolDef

src/main/core/MCPServer.ts:45–52  ·  view source on GitHub ↗

工具定义:name + 描述 + JSON Schema(不依赖 zod,手写 inputSchema)

Source from the content-addressed store, hash-verified

43
44/** 工具定义:name + 描述 + JSON Schema(不依赖 zod,手写 inputSchema) */
45interface ToolDef {
46 name: string
47 description: string
48 inputSchema: Record<string, any>
49 /** 是否高风险(用于审批策略默认值与提示) */
50 risky?: boolean
51 handler: (args: Record<string, any>) => Promise<MCPToolResult>
52}
53
54function resultText(result: MCPToolResult): string | undefined {
55 const parts = result?.content

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected