From ba02b5bee32a7bc0150c523850db876c0c798d4a Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 19 Nov 2025 01:53:18 +0000 Subject: [PATCH] fix: remove misleading 'Retrying...' from MCP invalid JSON error message The error message for invalid JSON arguments in MCP tool calls incorrectly stated 'Retrying...' when no automatic retry was actually happening. This was misleading users into thinking the system would automatically retry with corrected JSON. Changed the message to clearly indicate the error and instruct users to manually retry with properly formatted JSON. Fixes #9378 --- src/core/tools/__tests__/useMcpToolTool.spec.ts | 4 ++-- src/i18n/locales/en/mcp.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/tools/__tests__/useMcpToolTool.spec.ts b/src/core/tools/__tests__/useMcpToolTool.spec.ts index 130047ae15..7fbd120fcb 100644 --- a/src/core/tools/__tests__/useMcpToolTool.spec.ts +++ b/src/core/tools/__tests__/useMcpToolTool.spec.ts @@ -24,7 +24,7 @@ vi.mock("../../prompts/responses", () => ({ vi.mock("../../../i18n", () => ({ t: vi.fn((key: string, params?: any) => { if (key === "mcp:errors.invalidJsonArgument" && params?.toolName) { - return `Roo tried to use ${params.toolName} with an invalid JSON argument. Retrying...` + return `Failed to use ${params.toolName}: Invalid JSON argument provided. Please ensure the arguments are properly formatted JSON and try again.` } if (key === "mcp:errors.toolNotFound" && params) { return `Tool '${params.toolName}' does not exist on server '${params.serverName}'. Available tools: ${params.availableTools}` @@ -164,7 +164,7 @@ describe("useMcpToolTool", () => { expect(mockTask.consecutiveMistakeCount).toBe(1) expect(mockTask.recordToolError).toHaveBeenCalledWith("use_mcp_tool") - expect(mockTask.say).toHaveBeenCalledWith("error", expect.stringContaining("invalid JSON argument")) + expect(mockTask.say).toHaveBeenCalledWith("error", expect.stringContaining("Invalid JSON argument")) expect(mockPushToolResult).toHaveBeenCalledWith("Tool error: Invalid args for test_server:test_tool") }) }) diff --git a/src/i18n/locales/en/mcp.json b/src/i18n/locales/en/mcp.json index 0200e26d22..fcb302de88 100644 --- a/src/i18n/locales/en/mcp.json +++ b/src/i18n/locales/en/mcp.json @@ -5,7 +5,7 @@ "invalid_settings_validation": "Invalid MCP settings format: {{errorMessages}}", "create_json": "Failed to create or open .roo/mcp.json: {{error}}", "failed_update_project": "Failed to update project MCP servers", - "invalidJsonArgument": "Roo tried to use {{toolName}} with an invalid JSON argument. Retrying...", + "invalidJsonArgument": "Failed to use {{toolName}}: Invalid JSON argument provided. Please ensure the arguments are properly formatted JSON and try again.", "refresh_after_disable": "Failed to refresh MCP connections after disabling", "refresh_after_enable": "Failed to refresh MCP connections after enabling", "disconnect_servers_partial": "Failed to disconnect {{count}} MCP server(s). Check the output for details.",