diff options
| author | spoons-and-mirrors <[email protected]> | 2025-08-11 07:59:50 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-11 01:59:50 -0400 |
| commit | b223a29603f489063acced737b3004c32c1cf606 (patch) | |
| tree | 5754747607c22d11c12bca7e1bd961418052c0e7 | |
| parent | 8ed72ae0877884fb61bf346eb55e040f45c5cfe8 (diff) | |
| download | opencode-b223a29603f489063acced737b3004c32c1cf606.tar.gz opencode-b223a29603f489063acced737b3004c32c1cf606.zip | |
Fix: Sanitize MCP Tool Names for Consistency in User Expectations (#1769)
| -rw-r--r-- | packages/opencode/src/mcp/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts index 8f614b63a..664111fb2 100644 --- a/packages/opencode/src/mcp/index.ts +++ b/packages/opencode/src/mcp/index.ts @@ -149,7 +149,8 @@ export namespace MCP { for (const [clientName, client] of Object.entries(await clients())) { for (const [toolName, tool] of Object.entries(await client.tools())) { const sanitizedClientName = clientName.replace(/\s+/g, "_") - result[sanitizedClientName + "_" + toolName] = tool + const sanitizedToolName = toolName.replace(/[-\s]+/g, "_") + result[sanitizedClientName + "_" + sanitizedToolName] = tool } } return result |
