adb_get_system_info
Retrieve Android device system information including hardware and software details for debugging and management purposes.
Instructions
Get system information from the 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": "adb_get_system_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | Device ID (optional) |
Implementation Reference
- src/tools/shell.ts:60-107 (handler)Core handler function that runs multiple ADB shell commands to gather device system information including Android version, manufacturer, model, kernel, uptime, memory, and CPU info.
async getSystemInfo(deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot get system info - device is not connected' }; } const commands = { androidVersion: 'getprop ro.build.version.release', apiLevel: 'getprop ro.build.version.sdk', manufacturer: 'getprop ro.product.manufacturer', model: 'getprop ro.product.model', brand: 'getprop ro.product.brand', device: 'getprop ro.product.device', buildId: 'getprop ro.build.id', kernel: 'uname -r', uptime: 'uptime', meminfo: 'cat /proc/meminfo | head -5', cpuinfo: 'cat /proc/cpuinfo | grep "model name" | head -1' }; const systemInfo: Record<string, string> = {}; for (const [key, cmd] of Object.entries(commands)) { const result = await this.adbClient.executeCommand(`shell ${cmd}`, deviceId); systemInfo[key] = result.success ? result.output.trim() : 'N/A'; } return { success: true, data: { ...systemInfo, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: 'System information retrieved successfully' }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to get system info' }; } } - src/index.ts:373-386 (registration)Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and input schema (optional deviceId).
{ name: 'adb_get_system_info', description: 'Get system information from the device', inputSchema: { type: 'object', properties: { deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: [], }, }, - src/index.ts:475-476 (handler)Dispatch handler in the CallToolRequestSchema switch statement that invokes the ShellTools.getSystemInfo method.
case 'adb_get_system_info': return await this.handleToolCall(this.shellTools.getSystemInfo(args?.deviceId as string));