Skip to content

Commit 3bcaa5d

Browse files
authored
fix: temp tool rename fix (#278)
1 parent 54b0dba commit 3bcaa5d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/mcp/src/utils/registry-utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ export async function registerToolsets(
9191
const existingToolNames = new Set(toolRegistry.map(tool => tool.getName()));
9292
// Validate that all requested tools exist
9393
const invalidTools = tools.filter(toolName => !existingToolNames.has(toolName));
94+
95+
// This is a temporary fix to handle a tool rename. Tool alias support is coming soon.
96+
// If the invalid tools list includes the *old* create_lwc_component tool name
97+
if(invalidTools.includes('create_lwc_component')) {
98+
ux.stderr('Tool "create_lwc_component" has been renamed to "create_lwc_component_from_prd". Update config to remove this warning.')
99+
// Remove that entry from invalidTools
100+
invalidTools.splice(invalidTools.indexOf('create_lwc_component'), 1);
101+
// Then rename the old tool with create_lwc_component_from_prd in the tools array
102+
tools[tools.indexOf('create_lwc_component')] = 'create_lwc_component_from_prd';
103+
}
104+
94105
if (invalidTools.length > 0) throw new Error(`Invalid tool names provided to --tools: "${invalidTools.join('", "')}"
95106
Valid tools include:
96107
- ${Array.from(existingToolNames).join(`${EOL}- `)}`);

0 commit comments

Comments
 (0)