Skip to content

Dataset tools of the MCP server ​

The 21 tools that work on datasets, their tags and their groups. How to connect, and how results and errors come back, is in Connecting a client.

Shared values:

  • Dataset types: MULTICLASS, ANOMALY, MULTILABEL, imageObjectDetection, imageObjectDetectionOBB, OCR.
  • Divisions: train, test, validation, predetermined, review.
  • Most tools that take a datasetId answer dataset <id> not found when it does not exist.

Reading ​

dataset_list ​

Lists the datasets of the project, newest first, as summaries: id, name, type, description, archived flag, dates and the counters of tags, images and models.

ParameterTypeRequiredMeaning
limitinteger, 1 to 100noHow many to return. Default 20
typedataset typenoOnly datasets of this type
namestringnoText contained in the name or the id, in any letter case
includeArchivedbooleannoAlso return archived datasets
archivedbooleannotrue: only archived datasets
orderasc or descnoDefault desc, newest first

dataset_get ​

Returns one dataset with its tags.

ParameterTypeRequiredMeaning
datasetIdstringyes
tagStatsbooleannoAdd the image count of each tag
divisionsbooleannoAdd the image count of each division
modelsbooleannoAdd the models of the dataset, summarized
fieldsarray of stringsnoReturn only these top-level fields

dataset_images ​

Queries the images of a dataset, page by page. Returns count, total, pagination and images.

ParameterTypeRequiredMeaning
datasetIdstringyes
pageinteger, from 0noPage number. The first page is 0
perPageinteger, 1 to 100noDefault 20
divisiondivisionnoOnly images of this division
byTagstringnoOnly images that contain this tag id
byTagExcludebooleannoInverts byTag: images that do not contain the tag
byGroupstringnoA group id, or none for images without group
namestringnoText contained in the image name
withCommentsbooleannoOnly images with comments
orderdate, name or updatedAtnoSort field. Default date
directionasc or descnoSort direction. Default desc
fieldsarray of stringsnoReturn these stored fields of each image instead of the summary, for example tags, masks, imageData

The summary of an image has its id, name, file name, division (set), class (tag), labeled flag, groups, file location, preview URLs, the number of annotations, the tags it contains, the masks with the number of strokes of each, whether it has comments, and its dates. The strokes of the masks are large and come only when fields asks for masks.

Some combinations of filter and order need a database index that the project may not have. The call then fails with the error the database gives, which names the missing index.

Results are cached for a minute, so a change made in the application can take that long to show.

dataset_tag_stats ​

Image count per tag, plus the totals of labeled and not labeled images.

ParameterTypeRequired
datasetIdstringyes

dataset_division_stats ​

Image count per division.

ParameterTypeRequiredMeaning
datasetIdstringyes
byTagstringnoCount only images with this tag
byGroupstringnoCount only images of this group

dataset_annotation_counts ​

Number of annotations (boxes, masks, instances) of each tag across the images of the dataset, as an object { tagId: count }.

ParameterTypeRequired
datasetIdstringyes

dataset_tags ​

The tags of a dataset with their color, description and system flags.

ParameterTypeRequiredMeaning
datasetIdstringyes
includeSystembooleannofalse leaves out the unclassified tag and, in segmentation datasets, the normal tag. Default true

dataset_groups ​

The groups of a dataset.

ParameterTypeRequiredMeaning
datasetIdstringyes
statsbooleannoAdd the image count of each group. The result is then { groups, stats }

dataset_random_images ​

A random sample taken from the most recent images of a dataset, for a quick look at what it holds. Returns image summaries.

ParameterTypeRequiredMeaning
datasetIdstringyes
countinteger, 1 to 20noHow many images. Default 1
sampleSizeinteger, 1 to 500noHow many of the most recent images to pick from. Default 50

dataset_prompts ​

The prompts for vision-language models stored on a dataset.

ParameterTypeRequired
datasetIdstringyes

Datasets ​

dataset_create ​

Creates a dataset and the system tags of its type. The name is normalized (lower case, without accents, spaces as _, other symbols removed, at most 32 characters) and the id is rp-<type prefix>-<name>, returned as datasetId: a detection dataset named Bottles gets the name bottles and the id rp-obj-bottles. The call fails if that id is taken.

ParameterTypeRequiredMeaning
namestringyes
typedataset typeyes
descriptionstringno

dataset_update ​

Changes the name, the description or the archived flag. Answers nothing to update when none of the three is given.

ParameterTypeRequired
datasetIdstringyes
namestringno
descriptionstringno
archivedbooleanno

dataset_delete ​

Destructive. Deletes the dataset with all its images and their files, its tags and groups, its models, their evaluation results and their share links. Returns the counters of what was deleted.

ParameterTypeRequired
datasetIdstringyes
confirmbooleanyes, true

On a dataset with many images, connect through the usapi URL so the call has time to finish; a deletion that is cut short can be repeated.

dataset_convert ​

Cloud only. Converts a dataset into another type, for example detection into classification. The conversion runs in the training service and creates a new dataset; the original stays.

ParameterTypeRequiredMeaning
datasetIdstringyesDataset to convert
targetTypedataset typeyesType of the new dataset
newDatasetNamestringyesName of the new dataset
parametersobjectnoParameters of the conversion

dataset_operation_create ​

Cloud only. Moves or copies images into a dataset. The call returns when the transfer is done, with the answer of the HTTP route in data: processed, skipped, failed (the ids that failed, the first 100), failedCount and requested. The rules of a transfer are the ones of the HTTP route: see Move or copy images.

The transfer itself runs in the long-running function. A client connected through the api URL still stops waiting after 60 seconds, while the transfer goes on: for large transfers connect through the usapi URL.

ParameterTypeRequiredMeaning
datasetIdstringyesDestination dataset
typestringyesmove or copy
imagesarray of stringsyesIds of the images to transfer. The call fails without them
keepDatebooleannocopy only: give each copy the date of its original
originTypestringnoType of the dataset the images come from. Only used for an image whose own dataset no longer exists

Tags ​

dataset_tag_create ​

Creates a tag. Answers tag <id> already exists if the id is taken. Returns tagId and the tag.

ParameterTypeRequiredMeaning
datasetIdstringyes
tagIdstringyesId of the tag, also its name when name is not given
namestringno
colorstringnoHex color such as #2563EB. Assigned automatically when omitted
descriptionstringno

dataset_tag_update ​

Changes the name, the color or the description of a tag. A new name renames the tag: every image passes to the new id, the name with / replaced by _, and the call fails if a tag with that id already exists. Changing only the color or the description keeps the id. System tags keep their name.

ParameterTypeRequired
datasetIdstringyes
tagIdstringyes
namestringno
colorstringno
descriptionstringno

dataset_tag_delete ​

Destructive. Deletes a tag and removes it from every image, with the mask files of its annotations. System tags cannot be deleted.

ParameterTypeRequired
datasetIdstringyes
tagIdstringyes
confirmbooleanyes, true

dataset_tags_combine ​

Destructive. Merges several tags into one: the images and annotations pass to mainTagId and the merged tags are deleted. mainTagId is created if it does not exist. System tags can only be the target.

ParameterTypeRequiredMeaning
datasetIdstringyes
mainTagIdstringyesTag that stays
tagIdsarray of stringsyesTags to merge into it. All must exist
confirmbooleanyes, true

If some image could not be rewritten, the three tools that rewrite tags answer N images could not be updated; run it again and keep the tags. Repeat a deletion or a merge as it was. A rename cut halfway leaves both tags and cannot be repeated: finish it with dataset_tags_combine.

Groups ​

dataset_group_create ​

Creates a group of images. Returns groupId and the group.

ParameterTypeRequired
datasetIdstringyes
namestringyes
colorstringno

dataset_group_delete ​

Destructive. Deletes a group and takes its images out of it. The images are not deleted. Answers group <id> not found if it does not exist. The result carries the answer of the HTTP route in data.

ParameterTypeRequired
datasetIdstringyes
groupIdstringyes
confirmbooleanyes, true