Commit c75c493
authored
[ENH] Enrich get_available_tags with rich metadata (description, value_type, applies_to) (#37)
#### Reference Issues/PRs
Fixes #30.
#### What does this implement/fix? Explain your changes.
Currently, `get_available_tags()` returns only a flat list of tag name
strings with no additional context. This causes LLMs to frequently
select the wrong tag or wrong value when filtering estimators (e.g.,
using `"capability:multivariate": true` instead of the correct
`"scitype:y": "multivariate"`).
This PR enhances `get_available_tags()` to return rich metadata for each
tag by leveraging `sktime.registry.all_tags()`. Each tag entry now
includes:
- **`tag`**: the tag name (e.g., `"scitype:y"`)
- **`description`**: human-readable explanation (e.g., `"The scitype of
the target variable y"`)
- **`value_type`**: expected value type (e.g., `"str"`, `"bool"`)
- **`applies_to`**: list of estimator types the tag applies to (e.g.,
`["forecaster", "classifier"]`)
**Files changed:**
- `src/sktime_mcp/registry/interface.py` — Updated
`get_available_tags()` to return rich metadata from
`sktime.registry.all_tags()`
- `src/sktime_mcp/server.py` — Updated tool description to reflect new
output format
Output now after changes (trucated) :
```log
{
"success": true,
"tags": [
{
"tag": "capability:multivariate",
"description": "does the object natively support time series with 2 or more variables?",
"value_type": "bool",
"applies_to": ["classifier", "clusterer", "early_classifier", "metric", "param_est", "regressor", "transformer"]
},
{
"tag": "capability:pred_int",
"description": "does the forecaster implement predict_interval or predict_quantiles?",
"value_type": "bool",
"applies_to": ["forecaster"]
},
{
"tag": "scitype:y",
"description": "The scitype of the target variable y",
"value_type": "str",
"applies_to": ["forecaster", "classifier", "regressor"]
}
]
}
```
#### Does your contribution introduce a new dependency? If yes, which
one?
No. This uses `sktime.registry.all_tags()` which is already part of the
existing `sktime` dependency.
#### What should a reviewer concentrate their feedback on?
- Whether the updated tool description in `server.py` is clear enough
for LLM consumption
#### Any other comments?
This change is fully backward-compatible at the tool level — the
response key is still `"tags"`, but each entry is now a dict instead of
a string. No new dependencies are introduced.
#### PR checklist
##### For all contributions
- [ ] I've added myself to the [list of
contributors](https://github.com/alan-turing-institute/sktime/blob/main/.all-contributorsrc).
- [ ] Optionally, I've updated sktime's
[CODEOWNERS](https://github.com/alan-turing-institute/sktime/blob/main/CODEOWNERS)
to receive notifications about future changes to these files.
- [ ] I've added unit tests and made sure they pass locally.
##### For new estimators
- N/A1 parent 5aae774 commit c75c493
2 files changed
Lines changed: 46 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
261 | 268 | | |
262 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
263 | 300 | | |
264 | 301 | | |
265 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
| |||
0 commit comments