api.tools

listDocuments()

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

账户上保存的每一文件文件,没有争论,没有信用,也没有快捷的快捷键 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.

和 api.files.list(), , 现时 api.tools 以便“列出我所拥有的东西”可以作为工具交给一个模型。

返回值

[
  {
    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"}]
# }
服务器布局没有显示

文件由文件的代号识别, 而不是在磁盘上路径识别。 这就是将一个能从任何地方( 您的脚本、 页面、 运行) 找到的代号保存在任何位置, 却不知道字节坐在哪里 。

列出什么,没有列出什么

名单清单没有列出
文件保存通过 api.files电脑上的档案文件 files.list()
为账户存储的附加附件桶中的东西——这些是 run({ action: "list" })
生成和保存的媒体手机浏览器里的任何信息

作为一种工具

它是少数没有争论的申报单之一,运行比一个光列出的单子更能说明问题:它用账户的文档回答问题 和 打电话者计算机的文件, 每个组名, 所以模型知道下一步要使用哪个标识符, 一个代号, 另一个路径。

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"}]}

错误

失败会引发服务器发送的信息。 没有空结果错误: 账户没有文件回答, 且没有空数组 。