Skip to main content
Glama

pull_file

Download files from Android devices to your local machine by specifying remote and local paths. This tool transfers data from connected Android devices for backup, analysis, or processing.

Instructions

Download a file from the Android device to the local machine.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remote_pathYesAbsolute path on the Android device
local_pathYesLocal filesystem path to save the file to
device_idNoDevice serial number

Implementation Reference

  • Actual implementation of the pull_file tool logic, executing ADB pull.
    export async function pullFile(
      remotePath: string,
      localPath: string,
      deviceId?: string
    ): Promise<string> {
      const resolved = await deviceManager.resolveDeviceId(deviceId);
      const validRemote = validateDevicePath(remotePath);
      validateLocalPath(localPath);
    
      const result = await adbExec(['pull', validRemote, localPath], resolved, 60000);
    
      log.info('File pulled', { remotePath: validRemote, localPath, deviceId: resolved });
      return `${result.stdout}\n${result.stderr}`.trim();
    }
  • MCP registration and handler wrapper for the 'pull_file' tool.
    server.registerTool(
      'pull_file',
      {
        description: 'Download a file from the Android device to the local machine.',
        inputSchema: {
          remote_path: z.string().describe('Absolute path on the Android device'),
          local_path: z.string().describe('Local filesystem path to save the file to'),
          device_id: z.string().optional().describe('Device serial number'),
        },
      },
      async ({ remote_path, local_path, device_id }) => {
        return await metrics.measure('pull_file', device_id || 'default', async () => {
          const result = await pullFile(remote_path, local_path, device_id);
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({ success: true, message: result }, null, 2),
            }],
          };
        });
      }
    );

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/divineDev-dotcom/android_mcp'

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