Contents

Search Library

library_search · Tools · Documents

Search Library item names and document text, most relevant first

Parameters

NameTypeRequiredDescription
kind"document" | "folder" | "file"NoOnly items of this kind.
limitintegerNoMost items to return.
media_kind"image" | "pdf" | "file" | "audio" | "video"NoOnly files of this media kind.
querystringYesWhat to look for, in words.
unfiledbooleanNotrue searches only The unfiled items, shown in the Library tree as the Other folder: files and documents that belong to no folder.

Search Library Tool#

library_search searches the Library: item names, and documents' text by words and meaning. The most relevant items come first, each with its score.

When to Use#

The agent uses it to find an item it doesn't know the location of. To browse a folder, use library_list.

Parameters#

Parameter Type Required Description
query string Yes What to look for, in words
kind string No Only items of this kind: document, folder or file. Folders are returned with documents and files unless kind narrows the search
media_kind string No Only files of this media kind: image, pdf, file, audio or video
unfiled boolean No true searches only the unfiled items (the Other folder)
limit integer No Most items to return: default 20, at most 50

Returns#

Field Type Description
items array Hits, most relevant first: each item as library_get returns item, plus score

Example Scenario#

{ "query": "quarterly revenue forecast", "kind": "document", "limit": 5 }

Notes#

  • An empty query is refused
  • Items the AI access policy does not let AI read are left out
  • Risk: read