MCPcopy Create free account
hub / github.com/Louisym/MiniCC / run_post_tool_use

Method run_post_tool_use

tutorials/08_hook_system.py:142–158  ·  view source on GitHub ↗

运行所有 PostToolUse hook。 如果任何一个 hook 返回"拒绝",工具结果会被标记为错误。

(
        self, tool_name: str, tool_input: str,
        tool_output: str, is_error: bool,
    )

Source from the content-addressed store, hash-verified

140 )
141
142 def run_post_tool_use(
143 self, tool_name: str, tool_input: str,
144 tool_output: str, is_error: bool,
145 ) -> HookRunResult:
146 """
147 运行所有 PostToolUse hook。
148
149 如果任何一个 hook 返回"拒绝",工具结果会被标记为错误。
150 """
151 return self._run_commands(
152 event=HookEvent.POST_TOOL_USE,
153 commands=self.config.post_tool_use,
154 tool_name=tool_name,
155 tool_input=tool_input,
156 tool_output=tool_output,
157 is_error=is_error,
158 )
159
160 def _run_commands(
161 self,

Callers 1

mainFunction · 0.95

Calls 1

_run_commandsMethod · 0.95

Tested by

no test coverage detected