(name: string, error: z.ZodError)
| 119 | } |
| 120 | |
| 121 | function validationError(name: string, error: z.ZodError): CallToolResult { |
| 122 | const accountGuidance = error.issues.some((issue) => issue.path[0] === 'account_id') |
| 123 | ? ` ${NON_CODEMODE_ACCOUNT_DISCOVERY_GUIDANCE}` |
| 124 | : '' |
| 125 | return toolError( |
| 126 | `Input validation error: Invalid arguments for tool ${name}: ${error.message}${accountGuidance}` |
| 127 | ) |
| 128 | } |
| 129 | |
| 130 | function toolError(message: string): CallToolResult { |
| 131 | return { content: [{ type: 'text', text: message }], isError: true } |
no test coverage detected