Get an API key
api.tools

listDocuments()

api.tools.listDocuments() → Promise<Source[]>

Every file kept on the account. No arguments, no credit — and the shortcut for api.files.list().

GET /api/filesfreeno arguments
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

It is the same call as api.files.list(), present on api.tools so that « list what I have » can be handed to a model as a tool.

Returns

[
  {
    id: "…",                       // the sourceId, to pass to readDocument()
    name: "report.md",
    category: "document",          // document | image | audio | video
    mimeType: "text/markdown",
    size: 9118,
    storageId: "…",                // where it lives, or null
    status: "ready",
    createdAt: "2026-10-05T18:02:11.000Z"
  }
]
documents = api.tools.list_documents()
# {
#   "computer": [{"name", "path", "type", "size"}],          # ~/.iagenify/files
#   "account":  [{"id": "…",                                  # the sourceId, for read_document()
#                 "name": "report.md", "category": "document",
#                 "mimeType": "text/markdown", "size": 9118,
#                 "storageId": "…", "status": "ready",
#                 "createdAt": "2026-10-05T18:02:11.000Z"}]
# }
Nothing of the server's layout is in there

A file is identified by its id, never by a path on a disk. That is what keeps an id usable from anywhere — your script, a page, a run — without anything knowing where the bytes sit.

What it lists, and what it does not

ListsDoes not list
Files saved through api.filesFiles on a computer — those are files.list()
Attachments stored for the accountObjects in a bucket — those are run({ action: "list" })
Media generated and savedAnything in a phone's browser

As a tool

It is one of the few declarations that take no argument, and the run makes more of it than a bare list: it answers with the account's files and the files of the caller's computer, each group named, so the model knows which identifier to use next — an id for one, a path for the other.

tools: {
  list_documents: api.tools.listDocuments,
  read_document: api.tools.readDocument,
}

// What the model is told, in a run:
// { computer: { storage: "MacBook", files: [{ path, mimeType, size }] },
//   server:   [{ sourceId, name, mimeType }] }
tools = {
    "list_documents": api.tools.list_documents,
    "read_document": api.tools.read_document,
}

# What the model is told, in a run:
# {"computer": {"storage": "MacBook", "files": [{"path", "mimeType", "size"}]},
#  "server":   [{"sourceId", "name", "mimeType"}]}

Errors

A failure raises the message the server gave. There is no empty-result error: an account with no file answers with an empty array.