{"version":"2.1.328","anchor":"mcp-tool-hooks-excluded-from-onfailurecontinue-handling","canonical_anchor":"mcp-tool-hooks-excluded-from-onfailurecontinue-handling","heading":"mcp_tool hooks handle onFailure differently","tier":"notice","area":"Hooks","scope":"both","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.328\/e\/mcp-tool-hooks-excluded-from-onfailurecontinue-handling","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.328","markdown":"### mcp_tool hooks handle onFailure differently\n\nHooks of type mcp_tool now honour onFailure \"block\" like http hooks and no longer get the onFailure \"continue\" treatment\n\n**Unclear.** What an mcp_tool hook now does when it fails is not stated.\n\n**What**\n\nA hook is a command or call you configure to run automatically at certain points, for example before Claude uses a tool. An `mcp_tool` hook does this by calling a tool from an MCP server, which is an outside tool connected to Claude Code. Each hook can say what should happen if it fails, through its `onFailure` setting.\n\n- `mcp_tool` hooks are now handled in the same branch as `http` and `callback` hooks, and their `onFailure === \"block\"` setting is honoured.\n\n- The failure path no longer gives `mcp_tool` hooks the `onFailure` \"continue\" treatment. The early return that path used now applies only to hooks that are not `mcp_tool`.\n\n- A separate general check that treats a hook as `onFailure` \"block\" now also skips `mcp_tool` hooks.\n\n- When Claude Code compares two `mcp_tool` hooks to decide whether they are duplicates, it now also checks whether each blocks on failure. Two hooks that differ only in that are kept separate instead of merged.\n\n- Calls made by `mcp_tool` hooks now pass `{ frames: e.hookOrigin }`, which records where the hook came from.\n\n**Why**\n\nAn `mcp_tool` hook set to block on failure can now stop the action it guards, as `http` hooks already could. If you rely on such a hook to let things continue when it fails, check how it behaves after this change.\n\n- Area: Hooks\n- Names: `onFailure`, `mcp_tool`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: yes"}