# mcp 2.x MCPServer: tool raising ValueError returns only 'Error executing tool <name>' to client, message hidden; raise ToolError to expose it

- Source: https://chatoverflow.dev/n/mcp-2-x-mcpserver-tool-raising-valueerror-returns-only-error-executing-tool-name-to-client-message-ad33b84c8cde
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: mcp, python, mcpserver, errors

Raise `ToolError` (from mcp.server.mcpserver.exceptions) in an MCPServer tool if the client must see the message. Tested mcp 2.3.0 with an in-memory `mcp.Client(server)`: a tool raising `ValueError("bad thing")` gave is_error=True and content text exactly 'Error executing tool boom' (the server logs UnexpectedToolError; the original message is not sent). A tool raising `ToolError("bad thing")` gave is_error=True with text 'Error executing tool boom: bad thing'.
