Usage Examples
Examples of tasks performed via sktime-mcp and their corresponding MCP tool calls.
🔄 End-to-End Examples
Example 1: Simple Forecasting
What you type:
“Forecast monthly airline passengers for the next 12 months using a probabilistic model.”
What happens:
The assistant searches sktime’s registry for forecasting models that support prediction intervals.
It picks a suitable model (e.g., ARIMA) and shows you the options, or asks you to choose.
Once confirmed, it instantiates the model, fits it on the
airlinedemo dataset, and generates a 12-month forecast.You receive the predicted values (and optionally prediction intervals) in the conversation.
What you get back (example):
Here are the forecasted airline passenger counts for the next 12 months:
Month
Forecast
Lower 95%
Upper 95%
1
450.2
420.1
480.3
2
455.1
418.7
491.5
…
…
…
…
The model used was ARIMA(1,1,1) fitted on the
airlinedataset (144 observations).
Follow-up prompts you could try:
“Try the same forecast with ExponentialSmoothing instead.”
“Show me the Python code to reproduce this.”
“Plot the forecast against the historical data.”
🔧 Detailed MCP Tool Calls
1. Discover models with prediction interval support:
{
"name": "list_estimators",
"arguments": {
"task": "forecasting",
"tags": {"capability:pred_int": true}
}
}
2. Inspect the chosen estimator:
{
"name": "describe_estimator",
"arguments": {"estimator": "ARIMA"}
}
3. Instantiate with specific parameters:
{
"name": "instantiate_estimator",
"arguments": {"estimator": "ARIMA", "params": {"order": [1, 1, 1]}}
}
Returns: {"handle": "est_abc123"}
4. Fit and predict:
{
"name": "fit_predict",
"arguments": {"estimator_handle": "est_abc123", "dataset": "airline", "horizon": 12}
}
Example 2: Pipeline Forecasting
What you type:
“I want to forecast with deseasonalization and detrending as preprocessing. Use ARIMA as the final model.”
What happens:
The assistant validates that
ConditionalDeseasonalizer → Detrender → ARIMAis a valid pipeline in sktime.It creates the pipeline and fits it on the data.
Predictions reflect the full preprocessing chain — deseasonalized, detrended, then forecast, then inverse-transformed back to the original scale.
What you get back:
Pipeline created: ConditionalDeseasonalizer → Detrender → ARIMA(1,1,1)
Forecast for the next 12 months on the
airlinedataset:
Month
Forecast
1
448.7
2
461.3
…
…
The preprocessing steps (deseasonalization and detrending) were applied automatically.
Follow-up prompts you could try:
“Replace ARIMA with ExponentialSmoothing in this pipeline.”
“Evaluate this pipeline with cross-validation.”
“What other preprocessing transformers are available?”
🔧 Detailed MCP Tool Calls
1. Validate composition:
{
"name": "validate_pipeline",
"arguments": {"components": ["ConditionalDeseasonalizer", "Detrender", "ARIMA"]}
}
Returns: {"valid": true}
2. Instantiate pipeline:
{
"name": "instantiate_pipeline",
"arguments": {
"components": ["ConditionalDeseasonalizer", "Detrender", "ARIMA"],
"params_list": [{}, {}, {"order": [1, 1, 1]}]
}
}
Returns: {"handle": "est_xyz789", "pipeline": "ConditionalDeseasonalizer → Detrender → ARIMA"}
3. Execute:
{
"name": "fit_predict",
"arguments": {"estimator_handle": "est_xyz789", "dataset": "airline", "horizon": 12}
}
Example 3: Forecasting on Your Own CSV
What you type:
“Load my sales data from /home/user/sales.csv — the date column is ‘month’ and the target is ‘revenue’. Then forecast 6 months ahead with AutoARIMA.”
What happens:
The assistant loads your CSV, using the columns you specified.
It auto-formats the data (infers frequency, handles missing values if needed) and reports a summary.
It instantiates
AutoARIMA, fits it on your data, and returns a 6-month forecast.
What you get back:
Loaded sales.csv: 48 rows, monthly frequency (2020-01 to 2023-12), target column “revenue”.
AutoARIMA selected order (2,1,1) with seasonal order (1,1,0,12).
Forecast:
Month
Revenue Forecast
2024-01
12,450
2024-02
13,100
…
…
🔧 Detailed MCP Tool Calls
1. Load data:
{
"name": "load_data_source",
"arguments": {
"config": {
"type": "file",
"path": "/home/user/sales.csv",
"time_column": "month",
"target_column": "revenue"
}
}
}
Returns: {"handle": "data_abc"}
2. Instantiate AutoARIMA:
{
"name": "instantiate_estimator",
"arguments": {"estimator": "AutoARIMA"}
}
Returns: {"handle": "est_def456"}
3. Fit and predict:
{
"name": "fit_predict",
"arguments": {"estimator_handle": "est_def456", "data_handle": "data_abc", "horizon": 6}
}
Example 4: Model Comparison
What you type:
“Compare NaiveForecaster, ExponentialSmoothing, and ARIMA on the airline dataset using cross-validation.”
What happens:
The assistant instantiates each model.
For each model, it runs cross-validated evaluation (expanding window backtest).
It presents a comparison table of error metrics so you can pick the best model.
What you get back:
Cross-validation results on
airline(3 folds, expanding window):
Model
Mean Absolute Error
RMSE
NaiveForecaster
38.2
45.1
ExponentialSmoothing
24.7
31.3
ARIMA(1,1,1)
22.1
28.9
ARIMA(1,1,1) performed best on this dataset.
Follow-up prompts:
“Use ARIMA then — forecast 24 months ahead.”
“Save the ARIMA model for later.”
“Export the comparison code as a Python script.”
Example 5: Background Training
What you type:
“Train ARIMA(1,1,1) on my airline dataset in the background so I can do other things.”
What happens:
The assistant creates an estimator.
It uses
fit_predict_asyncto launch the training job without blocking the connection.You get a job ID immediately and can check the status later.
What you get back:
Background training started! Job ID:
abc-123-def. You can ask me to check its status or list all running jobs.
Example 6: Auto-Formatting Data
What you type:
“Load /home/user/messy_data.csv and fix any missing values or timestamp issues.”
What happens:
The assistant loads the data and notices warnings.
It uses
format_time_seriesto infer frequency, fill missing values, and remove duplicates.It reports the cleaned data summary.
🛠️ Individual Tasks
Below are standalone tasks you can ask about at any time — they don’t need to be part of a larger workflow.
Discovering Models
“What classification models does sktime have?”
“Show me forecasters that handle missing data.”
“Tell me about the ThetaForecaster — what parameters does it take?”
Loading and Inspecting Data
“What demo datasets are available?”
“Load my data from /home/user/experiment.parquet with time column ‘ts’ and target ‘measurement’.”
“Describe the data I just loaded — how many rows, what’s the frequency?”
Exporting and Saving
“Give me the Python code for the pipeline I just built.”
“Save this fitted model to /home/user/models/best_forecaster.”
Cleanup
“Release all active handles to free up memory.”
“What handles are currently active?”
📋 MCP Tool Reference
For developers and advanced users who want to understand the full MCP tool signatures, see the Ideal MCP Tools design document. That page documents every tool’s input schema, parameters, and intended use cases.