Storage Tools¶
storage ¶
Storage and hardware tools.
list_block_devices
async
¶
List block devices.
Retrieves all block devices (disks, partitions, LVM volumes) with their name, size, type, mount point, and filesystem information.
Source code in src/linux_mcp_server/tools/storage.py
list_directories
async
¶
list_directories(
path: Annotated[str, "The directory path to analyze"],
order_by: Annotated[
OrderBy,
"Sort order - 'size', 'name', or 'modified' (default: 'name')",
] = OrderBy.NAME,
sort: Annotated[
SortBy,
"Sort direction - 'ascending' or 'descending' (default: 'ascending')",
] = SortBy.ASCENDING,
top_n: Annotated[
int | None,
Field(
description="Optional limit on number of directories to return (1-1000, only used with size ordering)",
gt=0,
le=1000,
),
] = None,
host: Host = None,
) -> str
List directories under a specified path.
Retrieves subdirectories with their size (when ordered by size) or modification time, supporting flexible sorting and result limiting.
Source code in src/linux_mcp_server/tools/storage.py
list_files
async
¶
list_files(
path: Annotated[str, "The path to analyze"],
order_by: Annotated[
OrderBy,
"Sort order - 'size', 'name', or 'modified' (default: 'name')",
] = OrderBy.NAME,
sort: Annotated[
SortBy,
"Sort direction - 'ascending' or 'descending' (default: 'ascending')",
] = SortBy.ASCENDING,
top_n: Annotated[
int | None,
Field(
description="Optional limit on number of files to return (1-1000, only used with size ordering)",
gt=0,
le=1000,
),
] = None,
host: Host = None,
) -> str
List files under a specified path.
Retrieves files with their size or modification time, supporting flexible sorting and result limiting. Useful for finding large or recently modified files.
Source code in src/linux_mcp_server/tools/storage.py
read_file
async
¶
Read the contents of a file.
Retrieves the full contents of a text file. The path must be absolute and the file must exist. Binary files may not display correctly.