| 98 | } |
| 99 | |
| 100 | export function parserToolArgs(toolAnalysis: ToolAnalysisConfig | undefined): string[] { |
| 101 | if (!toolAnalysis) return [`--tool-prefix=${mcpToolPrefix}`]; |
| 102 | const args: string[] = []; |
| 103 | const toolNames = new Set<string>(); |
| 104 | for (const matcher of toolAnalysis.matchers) { |
| 105 | if (matcher.kind === 'namePrefix') args.push(`--tool-prefix=${matcher.prefix}`); |
| 106 | if (matcher.kind === 'bashCommand') toolNames.add('Bash'); |
| 107 | } |
| 108 | for (const toolName of toolNames) args.push(`--tool-name=${toolName}`); |
| 109 | return args; |
| 110 | } |