tagGroup¶
Tag group operations organize tags into named collections with optional colors, icons and descriptions. A tag can belong to multiple tag groups simultaneously; its first group (groupId) supplies its fallback color when the tag has no color override of its own.
Every operation in this namespace targets a single library (see Choose a library or window).
| Operation | HTTP Endpoint | Permission | MCP Tool | Summary |
|---|---|---|---|---|
tagGroup.list |
POST /api/v1/tagGroup/list |
metadata.read |
tagGroup_list |
List all tag groups in display order. |
tagGroup.create |
POST /api/v1/tagGroup/create |
organize |
tagGroup_create |
Create a new tag group. |
tagGroup.update |
POST /api/v1/tagGroup/update |
organize |
tagGroup_update |
Update a tag group's name, color, icon or description. |
tagGroup.delete |
POST /api/v1/tagGroup/delete |
organize |
tagGroup_delete |
Delete a tag group while keeping all its tags. |
tagGroup.addTags |
POST /api/v1/tagGroup/addTags |
organize |
tagGroup_addTags |
Add existing or new tags to a tag group. |
tagGroup.removeTags |
POST /api/v1/tagGroup/removeTags |
organize |
tagGroup_removeTags |
Remove tags from a tag group. |
tagGroup.list¶
Returns every tag group in the library in display order, then by name. To see which tags belong to each group, cross-reference groupIds on entries from tag.list.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
TagGroup[] — array of tag group objects.
Example request
Example response
[
{
"id": 1,
"name": "Environment",
"color": "#3b9160",
"icon": "trees",
"description": "Outdoor weather, skies, and terrain"
},
{
"id": 2,
"name": "Lighting",
"color": "#e09f3e",
"icon": "sun",
"description": null
}
]
Events and errors
- Events emitted: None (read-only). Subscribe to
tagGroups.changedto detect changes. - Errors:
unauthorized,not_allowed(missingmetadata.read),unknown_library,library_offline. - Related:
tag.list,tagGroup.create.
tagGroup.create¶
Creates a new tag group with a trimmed non-empty name and an optional CSS color. To set an icon or description, follow up with tagGroup.update.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Tag group name; trimmed, must not be blank. |
color |
string |
No | null |
Optional CSS color value (for example "#3b9160"). |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
{ success: true; id: number }
| Field | Type | Description |
|---|---|---|
success |
true |
Confirms the tag group was created. |
id |
number |
Integer ID of the newly created tag group. |
Example request
Example response
Events and errors
- Events emitted:
tagGroups.changed. - Errors:
bad_request(Give it a namewhennameis blank),not_allowed(missingorganize),failed(duplicate group name or database error). - Related:
tagGroup.update,tagGroup.addTags.
tagGroup.update¶
Renames a tag group or updates its color, icon or description. Omitted fields retain their current values. Passing an empty string "" for color or icon clears that attribute to null; passing "" for description sets it to an empty string.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Integer tag group ID to update. |
name |
string |
No | Unchanged | New group name; trimmed, must not be blank when supplied. |
color |
string |
No | Unchanged | CSS color value; pass "" to clear. |
icon |
string |
No | Unchanged | Tabler icon name; pass "" to clear. |
description |
string |
No | Unchanged | Descriptive note shown in the tag manager. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
tagGroups.changed. - Errors:
bad_request(Give it a nameifnameis blank),failed(There is no such tag groupwheniddoes not exist, or duplicate group name),not_allowed(missingorganize). - Related:
tagGroup.list,tagGroup.delete.
tagGroup.delete¶
Deletes a tag group and removes its membership links. All tags that belonged to the group remain in the library and on their items; any tag whose primary groupId pointed to the deleted group falls back to another group it still belongs to, or becomes ungrouped (null).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Integer tag group ID to delete. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
tagGroups.changed. - Errors:
bad_request(missing or invalidid),not_allowed(missingorganize),failed(database error). - Related:
tagGroup.create,tagGroup.removeTags.
tagGroup.addTags¶
Adds one or more tags to a tag group without removing them from any other groups they already belong to. String tag names that do not yet exist in the library are created automatically; numeric tag IDs are verified upfront and must already exist. If a tag previously had no primary groupId, groupId is set to this group.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
groupId |
number |
Yes | — | Destination tag group ID. |
tags |
(string \| number)[] |
Yes | — | Tag names (created if new) or existing integer tag IDs. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
tags.changedandtagGroups.changed. - Errors:
not_found(any numeric tag ID intagsdoes not exist),failed(blank tag nameempty tagor nonexistentgroupId),not_allowed(missingorganize). - Related:
tagGroup.removeTags,tag.list.
tagGroup.removeTags¶
Removes one or more tags from a tag group. Every tag referenced in tags must exist in the library. Removing a tag from a group leaves the tag itself and all item assignments intact; if the tag's primary groupId was this group, it updates to another remaining group or null.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
groupId |
number |
Yes | — | Tag group ID to remove the tags from. |
tags |
(string \| number)[] |
Yes | — | Existing tag names or integer tag IDs to detach from the group. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
tags.changedandtagGroups.changed. - Errors:
not_found(any entry intagsdoes not exist),bad_request(missinggroupIdortags),not_allowed(missingorganize). - Related:
tagGroup.addTags,tagGroup.delete.