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

Class ToolRegistry

mini_claude_code/tools.py:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3from typing import Callable
4
5class ToolRegistry:
6 def __init__(self):
7 self._handlers: dict[str, Callable] = {}
8
9 def register(self, name: str, handler: Callable) -> "ToolRegistry":
10 if name in self._handlers:
11 raise ValueError(f"Tool already registered: {name}")
12 self._handlers[name] = handler
13 return self
14
15 def execute(self, name: str, tool_input_json: str) -> str:
16 handler = self._handlers.get(name)
17 if handler is None:
18 raise KeyError(f"Unknown tool: {name}")
19 return handler(tool_input_json)
20
21def bash_tool(input_json:str):
22 data = json.loads(input_json)

Callers 1

build_default_registryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected