Model tools of the MCP server
The 10 tools that work on models and trainings. How to connect, and how results and errors come back, is in Connecting a client.
Reading
model_list
Lists models, newest first, as summaries: id, dataset and its name, task, service, status, stop reason, dates, training time, description, exported formats, images per division and the main metrics.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
limit | integer, 1 to 100 | no | Default 20 |
datasetId | string | no | Only the models of this dataset |
status | string | no | Only models in this status, for example finished, training, failed or cancelled |
recent | boolean | no | Accepted for compatibility. It has no effect |
model_get
Returns the stored record of a model.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
modelId | string | yes | |
summary | boolean | no | Leave out the heavy parts: the logs, the confusion matrices, the detailed metric tables, the training configuration and the file locations. Ignored when fields is given |
fields | array of strings | no | Return only these top-level fields |
A full model record is large. Ask for summary: true or for fields unless the logs or the matrices are needed.
model_metrics
The metrics of a model with its confusion matrices, its classes, its data division, its status and its training time.
| Parameter | Type | Required |
|---|---|---|
modelId | string | yes |
model_evaluation_images
The images the model was evaluated on, each with its subset, its confusion-matrix cells and a download URL. Returns total, count and images, sorted by subset and name.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
modelId | string | yes | |
subset | validation or test | no | Only this subset |
includeResults | boolean | no | Add the inference results of each image in results. They are large |
urls | boolean | no | Work out the download URL of the images that have none stored. Default true. The URL is false when the file cannot be found |
limit | integer, 1 to 500 | no | Default 500 |
model_training_log
The log of a training, from one of three sources.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
modelId | string | yes | |
source | epochs, debug or remote | no | Default epochs |
limit | integer, 1 to 2000 | no | epochs and debug: return only the last entries. remote: page size, default 500 |
pageToken | string | no | remote only: continue from a previous page |
since | string | no | remote only: ISO timestamp to start from |
source | What it returns |
|---|---|
epochs | The metrics of each epoch, stored with the model |
debug | The curated debug log, stored with the model |
remote | Cloud only. The full output of the training, read page by page from the training service |
model_validate_to_train
Checks whether a dataset can be trained: minimum numbers of images and tags, and the divisions when the method is labeled. Returns whether it is valid, the errors, the warnings, the count per tag and the number of training images. Among other things it checks that a classification dataset has at least 2 classes, that each tag has at least 10 images or 10 annotations and, with labeled, that test and validation have at least one image each.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
datasetId | string | yes | |
tagIds | array of strings | no | Tags to train on. Default: every tag except unclassified |
method | auto or labeled | no | auto (default): random split. labeled: use the division each image already has |
Training
model_train
Cloud only. Launches a training. The dataset is validated first, as model_validate_to_train does, and the call fails with the errors if it is not ready. Returns modelId, the warnings, the number of training images and the images per division.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
datasetId | string | yes | |
modelName | string | yes | Becomes the id of the model. The call fails if a model with that id exists |
tagIds | array of strings | no | Tags to train on. Default: every tag except unclassified |
method | auto or labeled | no | auto (default): random split with dataDivision. labeled: use the division each image already has |
dataDivision | object | no | auto only: percentages { "train": 80, "validation": 10, "test": 10 }, which is the default |
saveSet | boolean | no | auto only: write the resulting division on the images |
advancedSettings | object | no | Advanced training settings, as the application sends them |
emails | array of strings | no | Addresses to notify |
The call returns once the training is accepted, not when it ends. Follow it with model_get or model_training_log.
model_stop_training
Cloud only. Cancels a training that is running. If the training service cannot cancel it, the error gives the reason.
| Parameter | Type | Required |
|---|---|---|
modelId | string | yes |
Sharing and deleting
model_share_link
Cloud only. Creates a share token for the results of a model, or reads the results behind an existing token. The answer of the HTTP route comes in data: for a new token, token and expiresAt. If both modelId and token are sent, token is used.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
modelId | string | one of the two | Create a link for this model |
expiresIn | string | no | With modelId: a number followed by h or d, or never. Default 7d |
token | string | one of the two | Read the results behind this token instead of creating a link |
Anyone who has the token can read the results without signing in: see Create a share link.
model_delete
Destructive. Deletes a model with its evaluation results and its share links. Returns the counters of what was deleted.
| Parameter | Type | Required |
|---|---|---|
modelId | string | yes |
confirm | boolean | yes, true |
A model that is waiting to train or training cannot be deleted: stop it first with model_stop_training.