List files

View as Markdown

List durable Files visible to the caller. This Tool is not Runtime-bound; use the Files resource client when you need relationship filters.

List Files

1const result = await bctrl.tools.call("files.list", {
2 prefix: "reports/",
3 limit: 50,
4});
5
6for (const file of result.files) {
7 console.log(file.id, file.name, file.size);
8}
9console.log(result.nextCursor);

This Tool is synchronous. Use the Files resource client when you need upload, download, update, or delete operations.

Request parameters

ParameterTypeRequiredDescription
prefixstringNoReturn paths beginning with this prefix.
cursorstringNoCursor returned by the previous page.
limitintegerNoResults per page. Defaults to 50; maximum 200.

Response

The result is { files, nextCursor }:

FieldTypeAlways presentDescription
files[].idFileIdYesDurable File identifier.
files[].namestringYesFile name.
files[].contentTypestring | nullYesMIME type, when known.
files[].sizenumberYesSize in bytes.
files[].metadataJsonObject | nullYesPublic metadata, when stored.
files[].createdAtstringYesCreation timestamp.
nextCursorstring | nullYesCursor for the next page, or null when complete.

Next