(data: unknown)
| 75 | * Serialize a tool result to MCP content format. |
| 76 | */ |
| 77 | export function toText(data: unknown): { |
| 78 | content: [{ type: 'text'; text: string }]; |
| 79 | } { |
| 80 | return { |
| 81 | content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], |
| 82 | }; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Wrap a tool handler to catch errors and return them as MCP error content. |
no test coverage detected