# fs_list

List a folder on the machine: name, kind (file, dir, symlink), size and change time of each entry, sorted by name. Hidden names only with hidden=true. Paths holding keys and credentials (~/.ssh, ~/.aws, cmdop's own folder and the like) are refused.

**In short:** Risk class [`read`](https://docs.cmdop.ai/reference/tools.md#risk-classes). Over MCP call `fs_list`; over HTTP send `"tool": "fs_list"` to [`POST /api/v1/call`](https://docs.cmdop.ai/reference/http/post-call.md).

## Arguments

Over MCP every tool also takes `machine`: the machine's name or id, optional when only one machine is online.

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `hidden` | `boolean` | no | Include names starting with a dot. Default: `false`. |
| `limit` | `integer` | no | At most this many entries (default 500, at most 5000), sorted by name. |
| `path` | `string` | yes | Folder on the machine. Absolute, or relative to the user's home folder; `~` is the home. |

## Result

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `entries` | `object[]` | yes |  |
| `path` | `string` | yes | The folder, resolved to an absolute path. |
| `truncated` | `boolean` | yes | More entries exist than were returned. |

## Examples

**MCP**

```json
{
  "name": "fs_list",
  "arguments": {
    "machine": "<machine>",
    "path": "<path>"
  }
}
```

**HTTP**

```bash
curl -sS -X POST "https://<contour>.cmdop.ai/api/v1/call" \
  -H "Authorization: Bearer $CMDOP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"machine":"<machine>","tool":"fs_list","args":{"path":"<path>"}}'
```

## Limits

The call times out after 15 s (`timed_out`). Available since version 0.0.1. A refused or failed call returns one of the [error codes](https://docs.cmdop.ai/reference/errors.md).
