( config: ServerConfig, fields: Omit<ToolLogFields, "success" | "durationMs" | "error">, content: ToolContent[], startedAt: number, )
| 298 | } |
| 299 | |
| 300 | function logFailedToolResponse( |
| 301 | config: ServerConfig, |
| 302 | fields: Omit<ToolLogFields, "success" | "durationMs" | "error">, |
| 303 | content: ToolContent[], |
| 304 | startedAt: number, |
| 305 | ): void { |
| 306 | logToolCall(config, { |
| 307 | ...fields, |
| 308 | success: false, |
| 309 | durationMs: Math.round(performance.now() - startedAt), |
| 310 | error: toolErrorPreview(content), |
| 311 | }); |
| 312 | } |
| 313 | |
| 314 | function textBlock(text: string): ToolContent { |
| 315 | return { type: "text", text }; |
no test coverage detected