MCPcopy Create free account
hub / github.com/zai-org/ChatGLM3 / dispatch_tool

Function dispatch_tool

tools_using_demo/tool_register.py:53–61  ·  view source on GitHub ↗
(tool_name: str, tool_params: dict)

Source from the content-addressed store, hash-verified

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

Callers 2

run_conversationFunction · 0.90
tool_register.pyFile · 0.70

Calls 1

tool_callFunction · 0.50

Tested by

no test coverage detected