SanitizePythonVariableName converts a parameter name to a valid Python identifier by replacing non-alphanumeric characters with underscores. This function ensures that parameter names from workflows can be used safely in Python code by: 1. Replacing any non-alphanumeric characters (except _) with u
(name string)
| 273 | // SanitizePythonVariableName("123param") // returns "_123param" |
| 274 | // SanitizePythonVariableName("valid_name") // returns "valid_name" |
| 275 | func SanitizePythonVariableName(name string) string { |
| 276 | return SanitizeIdentifierName(name, nil) |
| 277 | } |
| 278 | |
| 279 | // SanitizeToolID removes common MCP prefixes and suffixes from tool IDs. |
| 280 | // This cleans up tool identifiers by removing redundant MCP-related naming patterns. |