Skip to content

[BUG] Support callable function parameters in sktime-mcp #449

@pranavvp16

Description

@pranavvp16

Description:

Problem

Some sktime estimators accept callable function parameters that cannot be expressed through the MCP's
JSON-based tool interface. The primary example is CurveFitForecaster, which requires a function
parameter — a Python callable like numpy.exp or numpy.sin.

Currently, instantiate_estimator's _validate_params → _is_safe_value gate rejects anything beyond str,
int, float, bool, list, tuple, dict, None:

  # Callable values are rejected with:                                                                  
  # "Unsupported type for parameter 'function': ... Only primitive types are allowed."                  

This makes CurveFitForecaster (and any future estimator with callable params) completely unreachable
from the MCP.

Example usage

  {                                                                                                     
    "estimator": "CurveFitForecaster",                                                                  
    "params": {                                                                                         
      "function": "&numpy.exp"                                                                          
    }                                                                                                   
  }                                                                                                     

Would resolve to: CurveFitForecaster(function=numpy.exp).

Not sure but I think many of the estimators in sktime take a callable function as a param as well, which is not possible right now to pass via the sktime-mcp server

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions