+10
-4
lines changedFilter options
+10
-4
lines changed Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ import type {
42
42
import { isProduction } from '@fastgpt/global/common/system/constants';
43
43
import { Output_Template_Error_Message } from '@fastgpt/global/core/workflow/template/output';
44
44
import { splitCombinePluginId } from '@fastgpt/global/core/app/plugin/utils';
45
-
import { getMCPToolRuntimeNode } from '@fastgpt/global/core/app/mcpTools/utils';
45
+
import { getMCPParentId, getMCPToolRuntimeNode } from '@fastgpt/global/core/app/mcpTools/utils';
46
46
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
47
47
import { getMCPChildren } from '../mcp';
48
48
import { cloneDeep } from 'lodash';
@@ -227,9 +227,15 @@ export async function getChildAppPreviewNode({
227
227
228
228
const version = await getAppVersionById({ appId: parentId, versionId, app: item });
229
229
const toolConfig = version.nodes[0].toolConfig?.mcpToolSet;
230
-
const tool = toolConfig?.toolList.find((item) => item.name === toolName);
231
-
if (!tool || !toolConfig) return Promise.reject(PluginErrEnum.unExist);
232
-
230
+
const tool = await (async () => {
231
+
if (toolConfig?.toolList) {
232
+
// new mcp toolset
233
+
return toolConfig.toolList.find((item) => item.name === toolName);
234
+
}
235
+
// old mcp toolset
236
+
return (await getMCPChildren(item)).find((item) => item.name === toolName);
237
+
})();
238
+
if (!tool) return Promise.reject(PluginErrEnum.unExist);
233
239
return {
234
240
avatar: item.avatar,
235
241
id: appId,
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4