MCPcopy
hub / github.com/zai-org/ChatGLM3 / dispatch_tool

Function dispatch_tool

composite_demo/tool_registry.py:56–64  ·  view source on GitHub ↗
(tool_name: str, tool_params: dict)

Source from the content-addressed store, hash-verified

54
55
56def dispatch_tool(tool_name: str, tool_params: dict) -> str:
57 if tool_name not in _TOOL_HOOKS:
58 return f"Tool `{tool_name}` not found. Please use a provided tool."
59 tool_call = _TOOL_HOOKS[tool_name]
60 try:
61 ret = tool_call(**tool_params)
62 except:
63 ret = traceback.format_exc()
64 return str(ret)
65
66
67def get_tools() -> dict:

Callers 1

mainFunction · 0.90

Calls 1

tool_callFunction · 0.70

Tested by

no test coverage detected