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

Method tool

tutorials/18_design_patterns_for_agents.py:690–695  ·  view source on GitHub ↗

装饰器: @registry.tool("bash")

(self, name: str)

Source from the content-addressed store, hash-verified

688 self._handlers: dict[str, Callable] = {}
689
690 def tool(self, name: str):
691 """装饰器: @registry.tool("bash")"""
692 def decorator(func):
693 self._handlers[name] = func
694 return func
695 return decorator
696
697 def execute(self, name: str, inp: str) -> str:
698 return self._handlers[name](inp)

Callers 1

Calls

no outgoing calls

Tested by 1