Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.328 ·

mcp_tool hooks handle onFailure differently

Hooks of type mcp_tool now honour onFailure "block" like http hooks and no longer get the onFailure "continue" treatment

Group of 2 You'll notice Improvements
JSON All of v2.1.328
You'll noticeTier: how much it should matter to you
3Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
HooksArea: what it touches
ImprovementsKind: in v2.1.328,
ImprovementsSection of the release

Unclear What an mcp_tool hook now does when it fails is not stated.

What

A 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.

  • mcp_tool hooks are now handled in the same branch as http and callback hooks, and their onFailure === "block" setting is honoured.
  • 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.
  • A separate general check that treats a hook as onFailure "block" now also skips mcp_tool hooks.
  • 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.
  • Calls made by mcp_tool hooks now pass { frames: e.hookOrigin }, which records where the hook came from.

Why

An 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.

Read from
Names in the bundleonFailuremcp_tool
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Confirmed since Anthropic's documentation has since written up onFailure, on Run tool calls from code with Code Mode. On v2.1.329 or later, expect a call from code to run by default after a hook failure other than `the hook did not finish`. To choose whether the call runs, use a `command` or `http` hook and set [`onFailure`](https://code.claude.com/docs/e… code-mode see the edit
Confirmed since Anthropic's documentation has since written up mcp_tool, on spans. | `mcp_tool_use` | `tool_call` with `anthropic_mcp_server_name` | api/opentelemetry/spans see the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhat an mcp_tool hook now does when it fails is not stated.
Anthropic's documentation agreesAnthropic's documentation has since written up mcp_tool, on spans.
Anthropic's release notes agreeAdded "onFailure": "block" for mcp_tool hooks, as for command and HTTP hooks: a hook whose call fails blocks the action

See this entry in the whole of v2.1.328 →

Feedback