Get Library Item
library_get · Tools · Documents
Get a Library item: a document's blocks with their ids, or a file's attachment reference
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | The item's id (ULID) or slug, as library_list, library_search and library_get return them. |
limit | integer | No | Most blocks to return. |
offset | integer | No | Top-level blocks of the document to skip: content.next_offset from the previous page. |
Get Library Item Tool#
library_get reads one Library item by id or slug. A document comes with its blocks, each with the id the block tools address it by; a file comes with an attachment reference; a folder comes with its details only.
When to Use#
The agent uses it to read a document before editing it with library_blocks_append, library_block_update or library_block_delete, or to inspect a file before opening it with library_view. A folder's items are listed with library_list.
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 |
offset |
integer | No | Top-level blocks of the document to skip: content.next_offset from the previous page. Default 0 |
limit |
integer | No | Most blocks to return, from 1 to 100. Default 100 |
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 |
content |
object | Documents only: blocks (BlockNode objects, each whole with its 10-character id), offset, total (top-level block count), has_more, next_offset (null on the last page) |
linked_from |
array | Documents only: the documents whose content links to this one, each with id, slug, name, path (parent folder slugs; [] for the root and null when unfiled), and path_names (parent folder names; null when unfiled). Documents whose AI access policy denies AI reads are left out |
attachment |
object | Files only: item_id, kind (media kind), content_type, size_bytes, filename |
Example Scenario#
The agent reads a long document page by page:
{ "identifier": "q1-research-notes-ab12cd" }
{ "identifier": "q1-research-notes-ab12cd", "offset": 100 }
Or in smaller pages:
{ "identifier": "q1-research-notes-ab12cd", "offset": 20, "limit": 20 }
Notes#
offsetandlimitcount top-level blocks; a blockquote's child blocks carry ids too and come with it- A
limitoutside 1 to 100 is refused offsetandlimithave no effect on a folder or file- A file whose stored content is gone is refused with
The content of '<name>' is no longer available - An unknown or trashed identifier is refused with
Library item not found: <identifier> - Refused when the item's AI access policy denies reads:
AI access denied: this resource is not readable by AI tools. - Risk: read