( error: string, code: string = "ERROR", details?: any )
| 43 | * Create an error response with the given message and code |
| 44 | */ |
| 45 | export function formatErrorResponse( |
| 46 | error: string, |
| 47 | code: string = "ERROR", |
| 48 | details?: any |
| 49 | ): { |
| 50 | success: false; |
| 51 | error: string; |
| 52 | code: string; |
| 53 | details?: any; |
| 54 | } { |
| 55 | return { |
| 56 | success: false, |
| 57 | error, |
| 58 | code, |
| 59 | ...(details ? { details } : {}), |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Create a tool error response object |
no outgoing calls
no test coverage detected