We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2999dc commit 12f76b1Copy full SHA for 12f76b1
ui/src/views/tool/McpToolFormDrawer.vue
@@ -246,7 +246,10 @@ const submit = async (formEl: FormInstance | undefined) => {
246
await formEl.validate((valid: any) => {
247
if (valid) {
248
try {
249
- JSON.parse(form.value.code as string)
+ const parsed = JSON.parse(form.value.code as string)
250
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
251
+ throw new Error('Code must be a valid JSON object')
252
+ }
253
} catch (e) {
254
MsgError(t('views.applicationWorkflow.nodes.mcpNode.mcpServerTip'))
255
return
0 commit comments