MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / call_tool

Function call_tool

src/ifcmcp/ifcmcp/embedded.py:48–60  ·  view source on GitHub ↗

Non-throwing tool dispatcher. Always returns: {"ok": bool, "data": ...} or {"ok": false, "error": "...", "error_type": "...", ...}

(name: str, args: Any = None)

Source from the content-addressed store, hash-verified

46
47
48def call_tool(name: str, args: Any = None) -> dict[str, Any]:
49 """
50 Non-throwing tool dispatcher.
51 Always returns: {"ok": bool, "data": ...} or {"ok": false, "error": "...", "error_type": "...", ...}
52 """
53 try:
54 py_args = _coerce_args(args)
55 data = session.dispatch(name, py_args)
56 return {"ok": True, "data": data}
57
58 except Exception as e:
59 # Keep it short; avoid full tracebacks in tool output unless debugging.
60 return {"ok": False, "error_type": type(e).__name__, "error": str(e)}

Callers

nothing calls this directly

Calls 3

_coerce_argsFunction · 0.85
typeFunction · 0.50
dispatchMethod · 0.45

Tested by

no test coverage detected