From 4f7b48c03b51b99510b45cf1139d38b63228cd2f Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Fri, 12 Dec 2025 11:41:07 -0800 Subject: [PATCH] Fix 406 error in MCP tool execution - add Accept header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /mcp/call_tool endpoint was returning 406 "Not Acceptable" error because the request didn't include an Accept header. Fixed by adding "Accept": "application/json" to the request headers. Error message was: "Not Acceptable: Client must accept application/json" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- scripts/discordbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/discordbot.py b/scripts/discordbot.py index 64e3a52..4be40b7 100644 --- a/scripts/discordbot.py +++ b/scripts/discordbot.py @@ -88,7 +88,8 @@ async def execute_mcp_tool(tool_name: str, arguments: dict) -> str: base_url = LITELLM_API_BASE.rstrip('/') headers = { "Authorization": f"Bearer {LITELLM_API_KEY}", - "Content-Type": "application/json" + "Content-Type": "application/json", + "Accept": "application/json" } debug_log(f"Executing MCP tool: {tool_name} with args: {arguments}")