Windows-drives
Lists all drives detected by Windows, including local disks and removable devices.
Instructions
Get a list of all drives in the Windows system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:85-94 (handler)The tool 'Windows-drives' handler function 'get_drives' that returns a list of all drive letters by calling utils._enumerate_drives().
@mcp.tool( name="Windows-drives", description="Get a list of all drives in the Windows system", ) def get_drives() -> list[str]: """Get a list of all drives in the Windows system.""" try: return utils._enumerate_drives() except Exception: return [] - main.py:85-88 (registration)The @mcp.tool decorator that registers 'Windows-drives' with FastMCP.
@mcp.tool( name="Windows-drives", description="Get a list of all drives in the Windows system", ) - utils.py:1-8 (helper)The _enumerate_drives() helper function that uses ctypes and GetLogicalDrives Win32 API to enumerate available drive letters.
# Helper utilities for robustness def _enumerate_drives() -> list[str]: """Return list of available drive letters, e.g., ['C', 'D']""" import ctypes import string bitmask = ctypes.windll.kernel32.GetLogicalDrives() return [letter for i, letter in enumerate(string.ascii_uppercase) if bitmask & (1 << i)]