MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _tool_call_command

Function _tool_call_command

uncommon_route/proxy.py:1442–1454  ·  view source on GitHub ↗
(tool_call: dict[str, Any])

Source from the content-addressed store, hash-verified

1440
1441
1442def _tool_call_command(tool_call: dict[str, Any]) -> str:
1443 fn = tool_call.get("function") or {}
1444 if not isinstance(fn, dict):
1445 return ""
1446 raw_args = fn.get("arguments")
1447 if isinstance(raw_args, str):
1448 try:
1449 parsed = json.loads(raw_args)
1450 except json.JSONDecodeError:
1451 return raw_args
1452 if isinstance(parsed, dict) and isinstance(parsed.get("command"), str):
1453 return str(parsed["command"])
1454 return ""
1455
1456
1457def _command_for_tool_result(

Callers 1

_command_for_tool_resultFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected