(outputFormat: unknown)
| 149 | } |
| 150 | |
| 151 | function readMcpOutputFormat(outputFormat: unknown): McpOutputFormat { |
| 152 | if (outputFormat === undefined) return 'optimized'; |
| 153 | if (outputFormat !== 'optimized' && outputFormat !== 'json') { |
| 154 | throw new Error('Expected mcpOutputFormat to be "optimized" or "json".'); |
| 155 | } |
| 156 | return outputFormat; |
| 157 | } |
| 158 | |
| 159 | function stripMcpConfigFields(input: unknown): unknown { |
| 160 | if (!input || typeof input !== 'object' || Array.isArray(input)) return input; |