Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 24 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,22 @@ The `sktime-mcp` server exposes a rich suite of tools categorized logically. Eve

### Category 1: Discovery & Registry Tools

These tools enable the LLM to inspect the native `sktime` registry, search for estimators matching specific criteria, and understand their capability profiles.
These tools enable the LLM to inspect the native `sktime` registry, search for estimators, capability tags, or performance metrics, and understand their capability profiles.

#### 1. `list_estimators`
Discover estimator classes from the `sktime` registry by task type, capabilities, or name query.
#### 1. `query_registry`
Unified entry point to discover and search for estimators, capability tags, or performance metrics in the `sktime` ecosystem.
* **Arguments:**
* `task` (`str`, optional): Filter by task type. Valid values: `"forecasting"`, `"classification"`, `"regression"`, `"transformation"`, `"clustering"`, `"detection"`.
* `tags` (`dict[str, Any]`, optional): Key-value pairs filtering by capability tags (e.g., `{"capability:pred_int": true, "handles-missing-data": true}`).
* `query` (`str`, optional): Case-insensitive substring search on the estimator's class name or docstring.
* `target` (`str`, required): What registry target to search. Valid values: `"estimators"`, `"tags"`, `"metrics"`.
* `task` (`str`, optional): Filter estimators or metrics by task type (e.g. `"forecasting"`, `"classification"`, `"regression"`, `"transformation"`, `"clustering"`, `"detection"`, `"metric"`).
* `tags` (`dict[str, Any]`, optional): Key-value pairs filtering estimators by capability tags. Values must match each tag's expected type (bool, str, list, etc.; use `target="tags"` to inspect `value_type`). Example: `{"capability:pred_int": true, "scitype:y": "univariate"}`.
* `query` (`str`, optional): Case-insensitive substring search on names or descriptions.
* `limit` (`int`, optional, default=`50`): Maximum number of results to return.
* `offset` (`int`, optional, default=`0`): Number of entries to skip for pagination.
* **Returns:**
```json
{
"success": true,
"estimators": [
"results": [
{
"name": "ARIMA",
"task": "forecasting",
Expand All @@ -233,48 +234,32 @@ Discover estimator classes from the `sktime` registry by task type, capabilities
"import_path": "sktime.forecasting.arima.ARIMA"
}
],
"count": 1,
"total": 1
}
```

#### 2. `describe_estimator`
Get full documentation, hyperparameters, capability tags, and Python import path for a specific named estimator class.
#### 2. `describe_component`
Get full documentation, constructor parameters, capability tags, and Python import path for ANY specific class or component in the `sktime` ecosystem (estimators, transformers, splitters, metrics, aligners).
* **Arguments:**
* `estimator` (`str`, required): Name of the estimator class (e.g., `"ARIMA"`, `"NaiveForecaster"`).
* `name` (`str`, required): Name of the component class (e.g., `"ARIMA"`, `"SlidingWindowSplitter"`, `"MeanAbsolutePercentageError"`).
* **Returns:**
```json
{
"success": true,
"name": "ARIMA",
"description": "Autoregressive Integrated Moving Average...",
"params": {
"order": {
"type": "tuple",
"default": [1, 0, 0],
"description": "The (p,d,q) order of the model."
}
"task": "forecasting",
"module": "sktime.forecasting.arima",
"parameters": {
"order": {"default": [1, 0, 0], "required": false}
},
"tags": {
"capability:pred_int": true
},
"import_path": "sktime.forecasting.arima.ARIMA"
}
```

#### 3. `get_available_tags`
List all queryable capability tags across the `sktime` registry with their descriptions and expected value types.
* **Arguments:** None.
* **Returns:**
```json
{
"success": true,
"tags": {
"capability:pred_int": {
"type": "bool",
"description": "Whether the forecaster can compute prediction intervals.",
"scitype": "forecaster"
}
}
"tag_explanations": {
"capability:pred_int": "Whether the forecaster can compute prediction intervals."
},
"docstring": "Autoregressive Integrated Moving Average..."
}
```

Expand Down Expand Up @@ -945,8 +930,9 @@ Below are examples demonstrating how an LLM utilizes these redesigned tools to c
1. **Discover Models**
The LLM queries for forecasting models supporting prediction intervals.
```json
// list_estimators
// query_registry
{
"target": "estimators",
"task": "forecasting",
"tags": {
"capability:pred_int": true
Expand All @@ -958,9 +944,9 @@ Below are examples demonstrating how an LLM utilizes these redesigned tools to c
2. **Inspect Choice**
The LLM inspects the parameter schema of `"ARIMA"`.
```json
// describe_estimator
// describe_component
{
"estimator": "ARIMA"
"name": "ARIMA"
}
```

Expand Down
43 changes: 19 additions & 24 deletions docs/source/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The codebase is organized into **5 main layers**:

2. **`@server.list_tools()`**: Registers all available MCP tools
- Returns tool schemas (name, description, input schema)
- Tools span Discovery, Instantiation, Execution, Data, Export, Persistence, Validation, and Job Management. (e.g., `list_estimators`, `instantiate_pipeline`, `fit_predict_async`, `load_data_source`, `save_model`, `check_job_status`).
- Tools span Discovery, Instantiation, Execution, Data, Export, Persistence, Validation, and Job Management. (e.g., `query_registry`, `instantiate_pipeline`, `fit_predict_async`, `load_data_source`, `save_model`, `check_job_status`).

3. **`@server.call_tool(name, arguments)`**: Routes tool calls to implementations
- Validates arguments
Expand Down Expand Up @@ -306,19 +306,14 @@ Each file implements one or more MCP tools that LLMs can call.

#### `list_estimators.py`
**Tools**:
1. **`list_estimators_tool(task, tags, query, limit)`**
- Calls `registry.get_all_estimators(task, tags)`
- Returns: `{"success": True, "estimators": [...], "total": 50}`
1. **`query_registry_tool(target, task, tags, query, limit, offset)`**
- Queries the unified registry for estimators, capability tags, or performance metrics.
- Returns query results.

2. **`get_available_tags()`**
- Returns all capability tags
- Example: `["capability:pred_int", "handles-missing-data", ...]`

#### `describe_estimator.py`
**Tool**: `describe_estimator_tool(estimator)`
- Looks up estimator in registry
- Returns full EstimatorNode details
- Includes: name, task, module, tags, hyperparameters, docstring
#### `describe_component.py`
**Tool**: `describe_component_tool(name)`
- Looks up a component (estimator, splitter, metric, transformer) in the registry by name
- Returns detailed component information

#### `instantiate.py`
**Tools**:
Expand Down Expand Up @@ -382,14 +377,14 @@ Each file implements one or more MCP tools that LLMs can call.

**Steps**:
1. List datasets
2. Discover forecasting estimators
2. Discover forecasting estimators using `query_registry`
3. Filter by tags (probabilistic forecasters)
4. Describe an estimator
4. Describe a component using `describe_component`
5. Validate pipeline compositions
6. Instantiate estimator
7. Fit and predict
8. List active handles
9. Show available tags
9. Show available tags using `query_registry`

**Run**: `python examples/01_forecasting_workflow.py`

Expand All @@ -399,8 +394,8 @@ Each file implements one or more MCP tools that LLMs can call.
**Scenario**: User asks "Forecast airline passengers with a probabilistic model"

**LLM Steps**:
1. `list_estimators(task="forecasting", tags={"capability:pred_int": True})`
2. `describe_estimator("ARIMA")`
1. `query_registry(target="estimators", task="forecasting", tags={"capability:pred_int": True})`
2. `describe_component("ARIMA")`
3. `instantiate_estimator("ARIMA", {"order": [1,1,1]})`
4. `fit_predict(handle, "airline", 12)`

Expand Down Expand Up @@ -478,19 +473,19 @@ Each file implements one or more MCP tools that LLMs can call.

**Step 1: Discovery**
```
LLM → list_estimators(task="forecasting")
→ server.call_tool("list_estimators", {"task": "forecasting"})
list_estimators_tool(task="forecasting")
LLM → query_registry(target="estimators", task="forecasting")
→ server.call_tool("query_registry", {"target": "estimators", "task": "forecasting"})
query_registry_tool(target="estimators", task="forecasting")
→ registry.get_all_estimators(task="forecasting")
→ Returns: [{"name": "ARIMA", ...}, {"name": "NaiveForecaster", ...}, ...]
```

**Step 2: Description**
```
LLM → describe_estimator("ARIMA")
describe_estimator_tool("ARIMA")
LLM → describe_component("ARIMA")
describe_component_tool("ARIMA")
→ registry.get_estimator_by_name("ARIMA")
→ Returns: {"name": "ARIMA", "hyperparameters": {"order": ...}, ...}
→ Returns: {"name": "ARIMA", "parameters": {"order": ...}, ...}
```

**Step 3: Instantiation**
Expand Down
7 changes: 4 additions & 3 deletions docs/source/usage-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ Examples of tasks performed via sktime-mcp and their corresponding MCP tool call
**1. Discover models with prediction interval support:**
```json
{
"name": "list_estimators",
"name": "query_registry",
"arguments": {
"target": "estimators",
"task": "forecasting",
"tags": {"capability:pred_int": true}
}
Expand All @@ -54,8 +55,8 @@ Examples of tasks performed via sktime-mcp and their corresponding MCP tool call
**2. Inspect the chosen estimator:**
```json
{
"name": "describe_estimator",
"arguments": {"estimator": "ARIMA"}
"name": "describe_component",
"arguments": {"name": "ARIMA"}
}
```

Expand Down
Loading
Loading