> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Task Files

> Lists the files attached to an earlier task of the same agent, so an agent can reuse a document that arrived on an earlier task.

Lists the files attached to an earlier task of the same agent, newest first, and says of each whether the task **received** it or **generated** it. Display name **"List Task Files"**. Off by default.

Use it when a document arrived on an earlier task and is needed now. For example, a case that comes in over several submissions may need a document from the first submission once the case is in scope. Store the earlier task's id, list its files, then call [`attach_task_file`](https://agents.nanonets.com/docs/tools/attach-task-file) to bring one onto the running task and get a `file_url` an extraction tool can read.

## Authentication and enablement

No integration. Off by default; enable it on the agent's tools list. Read-only.

## Inputs

| Field | Type | Required | Description |
| - | - | - | - |
| `task_id` | string (UUID) | yes | The task whose files to list. It must be a task of the same agent as the running task. |
| `origin` | string | no | `received` lists only the documents the task was sent; `generated` only the files it produced. Omit for both. |

## Output

```json theme={null}
{
  "task_id": "58b488ff-…",
  "files": [
    {
      "file_id": "0c9e…41d2",
      "name": "collection_request_form.pdf",
      "mime_type": "application/pdf",
      "file_size": 184233,
      "created_at": "2026-10-21T09:14:03Z",
      "origin": "received"
    }
  ],
  "total": 1,
  "truncated": false
}
```

* `files`: the task's files that have not been deleted, newest first. There are no URLs here; use `attach_task_file` for one.
* `origin`:
  * `received` means the task was sent the file: a trigger's or API call's attachment, an email attachment, a file a user added in a message, or a file the task got from another task (through `attach_task_file`, or because the task was forked from it). A forked task's copies of the original's outputs therefore read as `received`.
  * `generated` means the task's own tools wrote the file while it ran, such as a split document, a converted copy or an output workbook.
* `total`: how many files match (all of them, or only the requested `origin`). `truncated` is `true` when there are more than the 200 listed.

## Limits and side effects

* No side effects, and no model call.
* Lists at most 200 files, the newest first.
* Same agent only: the agent's own tasks, in any of its versions. A task of another agent, or in another workspace, returns the same error as a task that does not exist. This keeps a document within the reach of the people who can see that agent's tasks. A deleted task has no files to list.

## Expected errors

* `task <id> not found`: no task with that id for this agent, or the task was deleted.
* `task_id must be a task UUID`: the input is not a UUID.
* `origin must be "received" or "generated"`: any other `origin` value.
* `no task in context`: called outside a running task.
* `task files are unavailable`: misconfigured deployment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.