Contents

List Library

library_list · Tools · Documents

List the Library from a folder to a depth, or the unfiled items, with cursor paging

Parameters

NameTypeRequiredDescription
cursorstringNonext_cursor from the previous page of the same listing.
depthinteger | "all"NoHow many levels to list below the folder: a number from 1, 1 being the items directly in it, or "all" for every level. Omit for one level.
kind"document" | "folder" | "file"NoOnly items of this kind; `folder` lists the folders alone.
limitintegerNoMost items to return.
pathstring[]NoFolder path as an array of folder slugs or ids from the root, as library_list and every returned item give them, e.g. ['projects-ab12cd', 'q1-x9y8z7']; [] is the root. A folder's name is not a path segment. The folder to list from. Omit for the root.
unfiledbooleanNotrue lists The unfiled items, shown in the Library tree as the Other folder: files and documents that belong to no folder. Leave `path` out with it.

List Library Tool#

library_list lists the Library from a folder to a depth, folders only or every kind, or lists the unfiled items shown as the Other folder.

When to Use#

The agent uses it to browse the Library tree and find item ids and slugs. Before writing to the Library it lists the folders to every level (kind: "folder", depth: "all"), which shows every folder, how they nest, and each folder's name and, separately, its slug. To find items by words, use library_search; to read one, use library_get.

Parameters#

Parameter Type Required Description
path string[] No The folder to list from, as folder slugs or ids from the root, e.g. ["projects-ab12cd", "q1-x9y8z7"]; [] or omitted is the root. A folder's name is not a path segment
unfiled boolean No true lists the unfiled items (the Other folder). Leave path out with it
depth integer or "all" No How many levels to list below the folder: 1 is the items directly in it, "all" every level. Omitted is one level
kind "document", "folder" or "file" No Only items of this kind; "folder" lists the folders alone
limit integer No Most items to return: default 50, at most 200
cursor string No next_cursor from the previous page of the same listing

Returns#

Field Type Description
path string[] or null The folder listed from, as its folders' current slugs; null for the unfiled items
items array The items in tree order: within a level folders first, then by name, and each folder followed by what is inside it. Each is shaped as library_get returns item; its slug, not its name, is what a path takes
has_more boolean More items follow
next_cursor string or null Pass as cursor for the next page

Example Scenario#

{ "kind": "folder", "depth": "all" }

Notes#

  • Naming both path and unfiled: true is refused
  • A folder on path that is not there is refused, naming the folder
  • A cursor is bound to the folder, depth and kind it was made for; passing it with others is refused
  • Items the AI access policy does not let AI read are left out; the tool reads on until the page is full
  • Risk: read