List directories
list_directoriesEnumerate directories under a specified absolute path and sort them by name, size, or modified time, with optional result limits. Use it to inspect folder structure on local or remote Linux hosts.
Instructions
List directories under a specified path with various sorting options.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"host": "<host>"
},
"name": "list_directories"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | System to run on: 'localhost' for the system the MCP server runs on, or a remote host to connect to via SSH | |
| path | Yes | Absolute path to the directory to analyze | |
| sort | No | Sort direction - 'ascending' or 'descending' (default: 'ascending') | ascending |
| top_n | No | Optional limit on number of directories to return (1-1000) | |
| order_by | No | Sort order - 'size', 'name', or 'modified' (default: 'name') | name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | Yes | ||
| total | No |