You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp/mcp.tsx
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,12 @@ import { useWorkflowStore } from '@/stores/workflows/workflow/store'
33
33
34
34
constlogger=createLogger('McpToolDeploy')
35
35
36
-
/** MCP tool names allow lowercase letters, numbers, and underscores only */
37
-
constTOOL_NAME_PATTERN=/^[a-z0-9_]+$/
36
+
/**
37
+
* Mirrors the server's `sanitizeToolName` output: lowercase alphanumerics with single
38
+
* underscores between segments. Disallows leading/trailing and consecutive underscores so
39
+
* the validated name matches exactly what the server persists (no silent rewrite).
40
+
*/
41
+
constTOOL_NAME_PATTERN=/^[a-z0-9]+(_[a-z0-9]+)*$/
38
42
constMAX_TOOL_NAME_LENGTH=64
39
43
40
44
/** InputFormatField with guaranteed name (after normalization) */
@@ -178,7 +182,7 @@ export function McpDeploy({
178
182
return`Tool name must be ${MAX_TOOL_NAME_LENGTH} characters or fewer`
179
183
}
180
184
if(!TOOL_NAME_PATTERN.test(trimmed)){
181
-
return'Tool name can only contain lowercase letters, numbers, and underscores'
185
+
return'Use lowercase letters and numbers, separated by single underscores'
0 commit comments