From 2cac4325122a2d91c635a5d44f7ea5076b821874 Mon Sep 17 00:00:00 2001 From: SuYao Date: Thu, 4 Dec 2025 21:02:12 +0800 Subject: [PATCH] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main/utils/mcp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/utils/mcp.ts b/src/main/utils/mcp.ts index 4a1dfd600b..60f21037a3 100644 --- a/src/main/utils/mcp.ts +++ b/src/main/utils/mcp.ts @@ -65,8 +65,8 @@ export function buildFunctionCallToolName(serverName: string, toolName: string, } // Replace invalid characters with underscores - // Keep only a-z, A-Z, 0-9, underscores, dashes, dots, colons (AI model compatible) - name = name.replace(/[^a-zA-Z0-9_.\-:]/g, '_') + // Keep only a-z, 0-9, underscores, dashes, dots, colons (AI model compatible) + name = name.replace(/[^a-z0-9_.\-:]/g, '_') // Ensure name starts with a letter or underscore (AI model requirement) if (!/^[a-zA-Z_]/.test(name)) {