get_usb_device
Retrieve information about connected USB devices to analyze system hardware and manage device connections for debugging and instrumentation tasks.
Instructions
Get the USB device connected to the system.
Returns:
Information about the USB device
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_usb_device"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/frida_mcp/cli.py:287-302 (handler)MCP tool handler for 'get_usb_device'. Retrieves the USB-connected Frida device directly using frida.get_usb_device() and returns its ID, name, and type, or raises ValueError if no USB device is found.
@mcp.tool() def get_usb_device() -> Dict[str, Any]: """Get the USB device connected to the system. Returns: Information about the USB device """ try: device = frida.get_usb_device() return { "id": device.id, "name": device.name, "type": device.type, } except frida.InvalidArgumentError: raise ValueError("No USB device found") - Supporting helper method in DeviceSelector for retrieving the USB device, used in device resolution logic (e.g., when device_id='usb').
def _get_usb_device(self) -> Any: try: return self._frida.get_usb_device() except self._frida.InvalidArgumentError as exc: # type: ignore[attr-defined] raise DeviceSelectionError("No USB devices detected") from exc - Call to _get_usb_device helper within _get_by_identifier method when identifier is 'usb'.
return self._get_usb_device()