Fix: Sanitize MCP Tool Names for Consistency in User Expectations (#1769)
This commit is contained in:
committed by
GitHub
parent
8ed72ae087
commit
b223a29603
@@ -149,7 +149,8 @@ export namespace MCP {
|
|||||||
for (const [clientName, client] of Object.entries(await clients())) {
|
for (const [clientName, client] of Object.entries(await clients())) {
|
||||||
for (const [toolName, tool] of Object.entries(await client.tools())) {
|
for (const [toolName, tool] of Object.entries(await client.tools())) {
|
||||||
const sanitizedClientName = clientName.replace(/\s+/g, "_")
|
const sanitizedClientName = clientName.replace(/\s+/g, "_")
|
||||||
result[sanitizedClientName + "_" + toolName] = tool
|
const sanitizedToolName = toolName.replace(/[-\s]+/g, "_")
|
||||||
|
result[sanitizedClientName + "_" + sanitizedToolName] = tool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user