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

Method execute

tutorials/18_design_patterns_for_agents.py:643–648  ·  view source on GitHub ↗

按名字查找并执行

(self, name: str, tool_input: str)

Source from the content-addressed store, hash-verified

641 self._handlers[name] = handler
642
643 def execute(self, name: str, tool_input: str) -> str:
644 """按名字查找并执行"""
645 handler = self._handlers.get(name)
646 if handler is None:
647 raise KeyError(f"unknown tool: {name}")
648 return handler(tool_input)
649
650 def list_tools(self) -> list[str]:
651 return list(self._handlers.keys())

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected