HookConfigMcpTool
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| ClaudeCodeBaseModel clawd_code_sdk.models.base Base model for all Claude Code Pydantic models. |
⋔ Inheritance diagram¶
graph TD
1992988369["settings.HookConfigMcpTool"]
2604142835["base.ClaudeCodeBaseModel"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2604142835 --> 1992988369
3879467795 --> 2604142835
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: ClaudeCodeBaseModel
MCP tool hook. Call a tool on an already-connected MCP server. See https://code.claude.com/docs/en/hooks#mcp-tool-hook-fields.
Source code in src/clawd_code_sdk/models/settings.py
if_
class-attribute
instance-attribute
¶
Optional permission-rule-syntax filter. Evaluated only on tool-related events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); on other events a hook with if set never runs. See https://code.claude.com/docs/en/hooks-guide#filter-hooks-with-matchers
input
class-attribute
instance-attribute
¶
Arguments passed to the tool. String values support ${path} substitution from hook JSON input (e.g., ${tool_input.file_path}, ${cwd})
on_failure
class-attribute
instance-attribute
¶
Whether the action that triggered the hook goes ahead when the hook fails: the server isn't connected, the tool returns an error, it times out, or the output is invalid. "block" does what exit code 2 does on that event, and denies the request on PermissionRequest. No effect on Stop, SubagentStop, TaskCompleted, and TeammateIdle hooks. Requires Claude Code v2.1.328 or later. See https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails
server
class-attribute
instance-attribute
¶
Name of a configured MCP server (must already be connected)
status_message
class-attribute
instance-attribute
¶
Custom spinner message displayed while the hook runs
timeout
class-attribute
instance-attribute
¶
Optional timeout in seconds (default: 600; lowered to 30 on UserPromptSubmit and 10 on MessageDisplay)
tool
class-attribute
instance-attribute
¶
Name of the tool to call on that server