formatMultiLineComment formats a description as comment lines using the given prefix (e.g., "# " or "// "). Trailing newlines from YAML block scalars are trimmed so no empty comment line is emitted.
(description, prefix string)
| 178 | // formatMultiLineComment formats a description as comment lines using the given prefix (e.g., "# " or "// "). |
| 179 | // Trailing newlines from YAML block scalars are trimmed so no empty comment line is emitted. |
| 180 | func formatMultiLineComment(description, prefix string) string { |
| 181 | return prefix + strings.ReplaceAll(strings.TrimRight(description, "\n"), "\n", "\n"+prefix) + "\n" |
| 182 | } |
| 183 | |
| 184 | // GenerateMCPScriptJavaScriptToolScript generates the JavaScript tool file for a mcp-script tool |
| 185 | // The user's script code is automatically wrapped in a function with module.exports, |
no outgoing calls
no test coverage detected