{"version":"2.1.217","anchor":"mcp-tool-errors-now-throw-typed-exceptions-in-workflow-scrip","canonical_anchor":"mcp-tool-errors-now-throw-typed-exceptions-in-workflow-scrip","heading":"MCP Tool Errors Now Throw Typed Exceptions in Workflow Scripts","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.217\/e\/mcp-tool-errors-now-throw-typed-exceptions-in-workflow-scrip","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.217","markdown":"### MCP Tool Errors Now Throw Typed Exceptions in Workflow Scripts\n\nThis is the most impactful behavioral change in this release for workflow authors.\n\nPreviously, MCP tool call failures inside workflow scripts silently resolved to `{error: string}` objects, making them indistinguishable from a successful tool call that returned an object with an `error` field. Now, MCP tool failures throw a proper `McpToolError` exception that crosses the VM sandbox boundary with structured fields.\n\nThe thrown error has:\n\n- `.name === \"McpToolError\"`\n- `.toolName` \u2014 the name of the MCP tool that failed\n- `.error` \u2014 the error message string\n- `.detail` \u2014 parsed JSON of the response body, if the error response was JSON\n\nIn scripts, use try\/catch:\n\n`try { const result = await mcp__server__tool({ ... }) } catch (e) { if (e.name === \"McpToolError\") { console.log(e.toolName, e.error, e.detail) } }` The behavior is gated by `tengu_repl_mcp_error_throw` (default: `true`). The system prompt documentation for workflow scripts has been updated to reflect that MCP tools THROW on failure while built-in tools return `{error: string}`.\n\n**Evidence**\n\n`McpToolError` class (search for `\"McpToolError\"`) and VM sandbox bridge (search for `\"_throwMcpVM\"`)\n\n- Flag `tengu_repl_mcp_error_throw`: Not enough to say (read for one account on one subscription tier against v2.1.217; this account: no value returned, anonymous baseline: no value returned, compiled default: on) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release."}