From a24d097264277c546b19dd7e6642ec2ab76ddde5 Mon Sep 17 00:00:00 2001 From: Joaquin Coromina Date: Fri, 30 May 2025 17:43:06 -0400 Subject: [PATCH 1/2] add remove prefix function for tool call, updated the tool call error to return tool call error response string rather than content object --- .../workbench/contrib/void/electron-main/mcpChannel.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts index 7e1be86b..39d5f79d 100644 --- a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts +++ b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts @@ -245,6 +245,10 @@ export class MCPChannel implements IServerChannel { } } + private _removeUniquePrefix(name: string) { + return name.split('_').slice(1).join('_') + } + private async _closeAllMCPServers() { for (const serverName in this.infoOfClientId) { await this._closeClient(serverName) @@ -310,7 +314,7 @@ export class MCPChannel implements IServerChannel { // Call the tool with the provided parameters const response = await client.callTool({ - name: toolName, + name: this._removeUniquePrefix(toolName), arguments: params }) const { content } = response as CallToolResult @@ -320,8 +324,7 @@ export class MCPChannel implements IServerChannel { // handle text response if (response.isError) { - throw new Error(`Tool call error: ${response.content}`) - // handle error + throw new Error(`Tool call error: ${returnValue.text}`) } // handle success From 9c642763f006c5a37561559c2820e6e89d506d75 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 20:39:57 -0700 Subject: [PATCH 2/2] update voidrules --- .voidrules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.voidrules b/.voidrules index 59586971..6c655134 100644 --- a/.voidrules +++ b/.voidrules @@ -10,3 +10,5 @@ In typescript, do NOT cast to types if not neccessary. NEVER lazily cast to 'any Do not add or remove semicolons to any of my files. Just go with convention and make the least number of changes. Never modify files outside src/vs/workbench/contrib/void without consulting with the user first. + +All types that map from a value A to B should be called bOfA. For example, if you create a hashmap that goes from toolId to toolName, it should be called toolNameOfToolId, etc.