Skip to main content
Glama

adb_pull_file

Use this tool to transfer files from an Android device to a local system by specifying the remote file path. Optionally, provide a local path and device ID for precise file management.

Instructions

Pull a file from device to local system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdNoDevice ID (optional)
localPathNoLocal file path (optional)
remotePathYesRemote file path on device

Implementation Reference

  • The `pullFile` method in FileTools class that executes the ADB pull command to retrieve a file from the device.
    async pullFile(remotePath: string, localPath?: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot pull file - device is not connected' }; } const finalLocalPath = localPath || path.join(process.cwd(), path.basename(remotePath)); const command = `pull "${remotePath}" "${finalLocalPath}"`; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to pull file' }; } return { success: true, data: { remotePath, localPath: finalLocalPath, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `File pulled from ${remotePath} to ${finalLocalPath}` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to pull file' }; }
  • Input schema definition for the `adb_pull_file` tool, specifying parameters like remotePath, localPath, and deviceId.
    { name: 'adb_pull_file', description: 'Pull a file from device to local system', inputSchema: { type: 'object', properties: { remotePath: { type: 'string', description: 'Remote file path on device', }, localPath: { type: 'string', description: 'Local file path (optional)', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['remotePath'], }, },
  • src/index.ts:467-468 (registration)
    Dispatch handler in the switch statement that routes `adb_pull_file` tool calls to the `fileTools.pullFile` method.
    case 'adb_pull_file': return await this.handleToolCall(this.fileTools.pullFile(args?.remotePath as string, args?.localPath as string, args?.deviceId as string));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/richard0913/adb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server