MCPcopy
hub / github.com/anthropics/claude-code / _matches_tool

Method _matches_tool

plugins/hookify/core/rule_engine.py:127–142  ·  view source on GitHub ↗

Check if tool_name matches the matcher pattern. Args: matcher: Pattern like "Bash", "Edit|Write", "*" tool_name: Actual tool name Returns: True if matches

(self, matcher: str, tool_name: str)

Source from the content-addressed store, hash-verified

125 return True
126
127 def _matches_tool(self, matcher: str, tool_name: str) -> bool:
128 """Check if tool_name matches the matcher pattern.
129
130 Args:
131 matcher: Pattern like "Bash", "Edit|Write", "*"
132 tool_name: Actual tool name
133
134 Returns:
135 True if matches
136 """
137 if matcher == '*':
138 return True
139
140 # Split on | for OR matching
141 patterns = matcher.split('|')
142 return tool_name in patterns
143
144 def _check_condition(self, condition: Condition, tool_name: str,
145 tool_input: Dict[str, Any], input_data: Dict[str, Any] = None) -> bool:

Callers 1

_rule_matchesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected