Non-throwing tool dispatcher. Always returns: {"ok": bool, "data": ...} or {"ok": false, "error": "...", "error_type": "...", ...}
(name: str, args: Any = None)
| 46 | |
| 47 | |
| 48 | def 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)} |
nothing calls this directly
no test coverage detected