Skip to content

tag

Tag operations list, inspect, rename, merge, recolor and delete tags across a library. Tag references (tag or elements of sources) accept either the tag's exact trimmed name (string) or its integer database ID (number). To add or remove tags on specific items, use item.addTags and item.removeTags. To organize tags into groups, see Tag groups.

Every operation in this namespace targets a single library (see Choose a library or window).

Operation HTTP Endpoint Permission MCP Tool Summary
tag.list POST /api/v1/tag/list metadata.read tag_list List every tag with its item count, color and groups.
tag.get POST /api/v1/tag/get metadata.read tag_get Fetch one tag by name or ID.
tag.rename POST /api/v1/tag/rename organize tag_rename Rename a tag, merging automatically if the target name exists.
tag.merge POST /api/v1/tag/merge organize tag_merge Merge one or more tags into a single target tag name.
tag.delete POST /api/v1/tag/delete organize tag_delete Delete a tag and remove it from every item.
tag.setColor POST /api/v1/tag/setColor organize tag_setColor Set or clear a tag's own color override.

tag.list

POST /api/v1/tag/list Permission: metadata.read Target: Library Callers: Web, MCP, Plugin MCP: tag_list

Returns every tag in the library ordered alphabetically (case-insensitive) by name. Each entry includes the count of non-trashed items carrying the tag, the tag's own color (if set), its primary groupId (used for inherited color) and all groupIds it belongs to.

Parameters

Parameter Type Required Default Description
library string No Active window's library Library ID from library.list, folder path or library name.

Returns

Tag[] — array of all tags in the library.

Example request

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/list \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
const tags = await curio.tag.list();
{
  "name": "tag_list",
  "arguments": {}
}

Example response

[
  {
    "id": 12,
    "name": "lighting",
    "groupId": 2,
    "color": null,
    "count": 37,
    "starred": false,
    "groupIds": [2]
  },
  {
    "id": 15,
    "name": "sky",
    "groupId": 1,
    "color": "#3b82f6",
    "count": 84,
    "starred": true,
    "groupIds": [1, 3]
  }
]

Events and errors

  • Events emitted: None (read-only). Subscribe to tags.changed to refresh when tags change.
  • Errors: unauthorized, not_allowed (missing metadata.read), unknown_library, library_offline.
  • Related: tag.get, tagGroup.list.

tag.get

POST /api/v1/tag/get Permission: metadata.read Target: Library Callers: Web, MCP, Plugin MCP: tag_get

Returns a single tag record by its name or integer ID. Name lookup trims surrounding whitespace and matches exact tag spelling.

Parameters

Parameter Type Required Default Description
tag string \| number Yes — Tag name or integer tag ID.
library string No Active window's library Library ID from library.list, folder path or library name.

Returns

Tag — matching tag object.

Example request

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/get \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tag": "sky"}'
const tag = await curio.tag.get({ tag: 'sky' });
{
  "name": "tag_get",
  "arguments": {
    "tag": "sky"
  }
}

Example response

{
  "id": 15,
  "name": "sky",
  "groupId": 1,
  "color": "#3b82f6",
  "count": 84,
  "starred": true,
  "groupIds": [1, 3]
}

Events and errors

  • Events emitted: None (read-only).
  • Errors: not_found (There is no tag <tag>), bad_request (missing tag), not_allowed (missing metadata.read).
  • Related: tag.list, view.show.

tag.rename

POST /api/v1/tag/rename Permission: organize Target: Library Callers: Web, MCP, Plugin MCP: tag_rename

Renames a tag and refreshes the full-text search index for every item carrying it. If another tag with newName (after trimming) already exists, the two tags are merged: all items carrying tag receive the existing target tag, and the old tag row is deleted. Always pass a non-empty newName.

Parameters

Parameter Type Required Default Description
tag string \| number Yes — Existing tag name or integer tag ID.
newName string Yes — Replacement tag name (trimmed before matching or saving).
library string No Active window's library Library ID from library.list, folder path or library name.

Returns

Done — { success: true }.

Example request

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/rename \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tag": "skies", "newName": "sky"}'
await curio.tag.rename({ tag: 'skies', newName: 'sky' });
{
  "name": "tag_rename",
  "arguments": {
    "tag": "skies",
    "newName": "sky"
  }
}

Example response

{
  "success": true
}

Events and errors

  • Events emitted: tags.changed.
  • Errors: not_found (There is no tag <tag>), bad_request (missing tag or newName), not_allowed (missing organize), failed (database error).
  • Related: tag.merge, tag.delete.

tag.merge

POST /api/v1/tag/merge Permission: organize Target: Library Callers: Web, MCP, Plugin MCP: tag_merge

Merges one or more existing tags (sources) into a single target tag name in one transaction. If target does not yet exist, the first source tag is renamed to target and each remaining source is merged into it; if target already exists, every source is merged into it and deleted. The full-text search index is refreshed for affected items. Every entry in sources must already exist.

Parameters

Parameter Type Required Default Description
sources (string \| number)[] Yes — Existing tag names or integer IDs to merge into target.
target string Yes — Destination tag name; created automatically if it does not exist.
library string No Active window's library Library ID from library.list, folder path or library name.

Returns

Done — { success: true }.

Example request

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/merge \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sources": ["cloud", "clouds", "overcast"], "target": "sky"}'
await curio.tag.merge({ sources: ['cloud', 'clouds', 'overcast'], target: 'sky' });
{
  "name": "tag_merge",
  "arguments": {
    "sources": ["cloud", "clouds", "overcast"],
    "target": "sky"
  }
}

Example response

{
  "success": true
}

Events and errors

  • Events emitted: tags.changed and tagGroups.changed.
  • Errors: not_found (any entry in sources does not exist), bad_request (missing sources or target), not_allowed (missing organize), failed (database error).
  • Related: tag.rename, tag.list.

tag.delete

POST /api/v1/tag/delete Permission: organize Target: Library Callers: Web, MCP, Plugin MCP: tag_delete

Permanently deletes a tag from the library, removes it from all items and tag groups and refreshes the full-text search index for items that previously carried it.

Parameters

Parameter Type Required Default Description
tag string \| number Yes — Tag name or integer tag 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

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/delete \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tag": "temp-import"}'
await curio.tag.delete({ tag: 'temp-import' });
{
  "name": "tag_delete",
  "arguments": {
    "tag": "temp-import"
  }
}

Example response

{
  "success": true
}

Events and errors

tag.setColor

POST /api/v1/tag/setColor Permission: organize Target: Library Callers: Web, MCP, Plugin MCP: tag_setColor

Sets or clears a tag's own color override. When a tag has no color of its own (null), it inherits the color of its primary tag group (groupId). Passing null, "" or omitting color clears the tag's individual override.

Parameters

Parameter Type Required Default Description
tag string \| number Yes — Tag name or integer tag ID.
color string No null CSS color string (for example "#3b82f6"); omit, pass null or pass "" to clear the override.
library string No Active window's library Library ID from library.list, folder path or library name.

Returns

Done — { success: true }.

Example request

curl -sS -X POST http://127.0.0.1:41733/api/v1/tag/setColor \
  -H "Authorization: Bearer $CURIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tag": "sky", "color": "#3b82f6"}'
await curio.tag.setColor({ tag: 'sky', color: '#3b82f6' });
{
  "name": "tag_setColor",
  "arguments": {
    "tag": "sky",
    "color": "#3b82f6"
  }
}

Example response

{
  "success": true
}

Events and errors