( error: string, code: string = "ERROR" )
| 166 | * Format an error prompt response in the MCP format |
| 167 | */ |
| 168 | export function formatPromptErrorResponse( |
| 169 | error: string, |
| 170 | code: string = "ERROR" |
| 171 | ): { |
| 172 | messages: Array<{ |
| 173 | role: "assistant"; |
| 174 | content: { |
| 175 | type: "text"; |
| 176 | text: string; |
| 177 | }; |
| 178 | }>; |
| 179 | error: string; |
| 180 | code: string; |
| 181 | _meta?: Record<string, unknown>; |
| 182 | [key: string]: unknown; |
| 183 | } { |
| 184 | return { |
| 185 | messages: [ |
| 186 | { |
| 187 | role: "assistant", |
| 188 | content: { |
| 189 | type: "text", |
| 190 | text: `Error: ${error}`, |
| 191 | }, |
| 192 | }, |
| 193 | ], |
| 194 | error, |
| 195 | code, |
| 196 | }; |
| 197 | } |
nothing calls this directly
no outgoing calls
no test coverage detected