List Directory
lsList files and folders in a directory with details: name, path, type, size, modified date. Filter by glob patterns, include hidden or ignored entries, sort by multiple criteria, and paginate through large sets.
Instructions
List immediate directory contents (non-recursive): name, path, type, size, modified date. Omit path for workspace root. includeIgnored=true for node_modules etc. For recursive search, use find.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Base directory (default: root). Absolute path required if multiple roots. | |
| includeHidden | No | Include hidden items (starting with .) | |
| includeIgnored | No | Include ignored items (node_modules, .git, etc). | |
| maxDepth | No | Max recursion depth when pattern is provided | |
| maxEntries | No | Maximum entries to return before truncation. Default: 20000 | |
| sortBy | No | Sort field (name, size, modified, type) | name |
| pattern | No | Optional glob pattern filter (e.g. "**/*.ts") | |
| includeSymlinkTargets | No | Resolve and include symlink targets in results | |
| cursor | No | Pagination cursor from a previous response |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| path | No | ||
| entries | No | ||
| totalEntries | No | ||
| truncated | No | ||
| totalFiles | No | ||
| totalDirectories | No | ||
| stoppedReason | No | maxEntries: entry limit hit; aborted: operation was cancelled | |
| skippedInaccessible | No | ||
| nextCursor | No | Cursor for the next page; absent on the final page |