Describe the bug
In src/sktime_mcp/runtime/executor.py line 171, predictions are
returned via .to_dict() without converting numpy types to Python
native types. This causes JSON serialization to fail in MCP responses
since numpy.float64 is not JSON serializable.
Location
src/sktime_mcp/runtime/executor.py:171
Minimal reproduction
Run any fit_predict call and inspect the returned dict — values will
be numpy.float64 instead of Python float.
Expected
Prediction values should be Python native float.
Actual
Prediction values are numpy.float64, which fails JSON serialization.
Proposed fix
Convert values at dict construction:
result = {str(k): float(v) if hasattr(v, 'item') else v
for k, v in predictions_copy.to_dict().items()}
Describe the bug
In
src/sktime_mcp/runtime/executor.pyline 171, predictions arereturned via
.to_dict()without converting numpy types to Pythonnative types. This causes JSON serialization to fail in MCP responses
since
numpy.float64is not JSON serializable.Location
src/sktime_mcp/runtime/executor.py:171Minimal reproduction
Run any fit_predict call and inspect the returned dict — values will
be numpy.float64 instead of Python float.
Expected
Prediction values should be Python native float.
Actual
Prediction values are numpy.float64, which fails JSON serialization.
Proposed fix
Convert values at dict construction:
result = {str(k): float(v) if hasattr(v, 'item') else v
for k, v in predictions_copy.to_dict().items()}