* 将任意工具返回值转成 MCP 文本内容,便于通用客户端展示。
(result: unknown)
| 411 | * 将任意工具返回值转成 MCP 文本内容,便于通用客户端展示。 |
| 412 | */ |
| 413 | private stringifyToolResult(result: unknown): string { |
| 414 | if (typeof result === 'string') return result |
| 415 | if (result === undefined) return '' |
| 416 | return JSON.stringify(result) |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * 发送 JSON-RPC 成功结果。 |
no test coverage detected