# listDocuments()

Canonical URL: https://developers.iagenify.com/ar/sdk/ref/tools/list-documents/
Language: ar

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

لا جدال، لا ائتمان، والاختصار لـ api.files.list().

Status: GET /api/files · free · no arguments

نفس الطلب [api.files.list()](/ar/sdk/ref/files/list)الحالية `api.tools` "حتى يتسنى تسليم ما لديّ إلى نموذج كأداة.

## القيمة المُعادة {#returns}

```javascript
[
  {
    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"
  }
]
```

> **لا شيء من خادم set secist موجود في**
>
> وهذا ما يبقي هوية قابلة للاستخدام من اي مكان — نصك ، صفحة ، تشغيل — دون ان يعرف اين تجلس الپايتات .

## ما هي القائمة وما لا {#scope}

| : | لا ليس ليس |
| --- | --- |
| منفذ `api.files` | ملفات على حاسوب حاسوب — تلك [files.list()](/ar/sdk/ref/local-files/list) |
| ملحقات مخزنة للحساب | في سلالة من الأشياء - تلك `run({ action: "list" })` |
| إنتاج وسائط الإعلام وحفظها | أي شيء في الهاتف |

## كأداة {#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.

```javascript
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 }] }
```

## الأخطاء {#errors}

فشل يزيد على الرسالة التي أعطاها الخادم. لا يوجد خطأ فارغ- سُلَطْح: حساب بدون أجوبة ملف مع مصفوفة فارغة.

- [readDocument()](/ar/sdk/ref/tools/read-document): إقرأ أحدهم للخلف
- [api.files](/ar/sdk/ref/files): كامل ملف المورد.
- [api.tools](/ar/sdk/ref/tools): الخمسة عشر و الطريقتان لاستخدامهم

```python
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"}]
# }
```

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