Skip to content

Commit fb0fdb9

Browse files
committed
refactor: enhance MCP server configuration tooltips and validation messages
--bug=1054206 --user=刘瑞斌 【应用】MCP节点不配置Server config,不选择工具,可以发布应用,对话时报错 https://www.tapd.cn/57709429/s/1679457
1 parent 5b2baaf commit fb0fdb9

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

ui/src/locales/lang/en-US/views/application-workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export default {
228228
tool: 'Tool',
229229
toolParam: 'Tool Params',
230230
mcpServerTip: 'Please enter the JSON format of the MCP server config',
231+
mcpToolTip: 'Please select a tool',
231232
configLabel: 'MCP Server Config (Only supports SSE call method)',
232233
},
233234
imageGenerateNode: {

ui/src/locales/lang/zh-CN/views/application-workflow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export default {
227227
getTool: '获取工具',
228228
tool: '工具',
229229
toolParam: '工具参数',
230-
mcpServerTip: '请输入 JSON 格式的 MCP 服务器配置',
230+
mcpServerTip: '请输入JSON格式的MCP服务器配置',
231+
mcpToolTip: '请选择工具',
231232
configLabel: 'MCP Server Config (仅支持SSE调用方式)'
232233
},
233234
imageGenerateNode: {

ui/src/locales/lang/zh-Hant/views/application-workflow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export default {
227227
getTool: '獲取工具',
228228
tool: '工具',
229229
toolParam: '工具變數',
230-
mcpServerTip: '請輸入 JSON 格式的 MCP 服務器配置',
230+
mcpServerTip: '請輸入JSON格式的MCP服務器配置',
231+
mcpToolTip: '請選擇工具',
231232
configLabel: 'MCP Server Config (僅支持SSE調用方式)',
232233
},
233234
imageGenerateNode: {

ui/src/workflow/nodes/mcp-node/index.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,21 @@ const validate = async () => {
343343
}
344344
}
345345
}
346-
let ps = [replyNodeFormRef.value?.validate()]
347-
return Promise.all(ps).catch((err: any) => {
348-
return Promise.reject({ node: props.nodeModel, errMessage: err })
349-
})
346+
if (replyNodeFormRef.value) {
347+
const form = cloneDeep(form_data.value)
348+
if (!form.mcp_servers) {
349+
return Promise.reject({
350+
node: props.nodeModel,
351+
errMessage: t('views.applicationWorkflow.nodes.mcpNode.mcpServerTip')
352+
})
353+
}
354+
if (!form.mcp_tool) {
355+
return Promise.reject({
356+
node: props.nodeModel,
357+
errMessage: t('views.applicationWorkflow.nodes.mcpNode.mcpToolTip')
358+
})
359+
}
360+
}
350361
}
351362
352363
onMounted(() => {

0 commit comments

Comments
 (0)