# Update Library Item Tool

`library_update` renames a Library item, or sets or clears its icon and icon color.

## When to Use

The agent uses it to retitle a document, rename a folder or file, or change how an item is drawn in the Library tree. Blocks are edited with the block tools; moving is `library_move`.

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `identifier` | string | Yes | The item's id (ULID) or slug, as `library_list`, `library_search` and `library_get` return them |
| `name` | string | No | The new name; a document's name is its title. Omit to keep it |
| `icon` | patch | No | Icon change. Omit to keep the current icon |
| `color` | patch | No | Icon color change. Omit to keep the current color |

Each patch is one of:

- `{"op": "set", "value": "..."}` replaces the value
- `{"op": "clear"}` removes it, so the default icon and color are drawn
- `{"op": "unchanged"}`, or omitting the field, keeps it

Both values are stored exactly as given, without validation. `icon`: a Phosphor icon as an Iconify id, `ph:` plus the icon's kebab-case name, such as `ph:notebook`; another `prefix:name` is passed to Iconify as is, a value without a colon is read as a Phosphor name, and an emoji or unknown name draws no icon. `color`: applied as the icon's CSS color; use a hex code `#rrggbb` (the picker offers `#b15d5c`, `#94751b`, `#54894a`, `#2a8e67`, `#008c93`, `#517aba`, `#846ab0`).

## Returns

| Field | Type | Description |
|-------|------|-------------|
| `item` | object | The item: `id`, `slug`, `name`, `kind` (`document`, `folder` or `file`), `path` (folder slugs; `null` when unfiled), `path_names`, `icon`, `color`, `ai_access_policy`, `revision`, `created_at`, `updated_at`, `url`; a file adds `object_id`, `media_kind`, `content_type`, `filename`, `size_bytes` |

`url` is the item's link. The agent gives it to the user when it reports the change, labelled with the item's name rather than its folder path.

## Example Scenario

```json
{ "identifier": "reading-list-ab12cd", "name": "Books 2026", "icon": { "op": "set", "value": "ph:book-open" } }
```

## Notes

- Renaming may change the slug: use the returned `slug` or the `id` afterwards
- An unknown or trashed identifier is refused with `Library item not found: <identifier>`
- Refused when the item's AI access policy denies reads or writes: `AI access denied: this resource is not writable by AI tools.` (or `not readable`)
- Risk: write
