Skip to main content
Glama

pull_file

Transfer files from an Android device to your computer by specifying remote and local paths, enabling easy access to device content.

Instructions

Pull a file from the Android device to the local filesystem.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remote_pathYesPath on the device (e.g., /sdcard/somefile.txt)
local_pathYesLocal path to save the file to
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • The actual implementation of the pull_file functionality that executes the ADB command.
    async pullFile(remotePath: string, localPath: string, deviceId?: string): Promise<string> {
      const dir = dirname(localPath);
      await mkdir(dir, { recursive: true });
      const fullArgs = deviceId
        ? ["-s", deviceId, "pull", remotePath, localPath]
        : ["pull", remotePath, localPath];
      const { stdout } = await execFileAsync(this.adbPath, fullArgs, {
        timeout: 30_000,
  • src/index.ts:573-585 (registration)
    The MCP tool registration and handler wrapper for pull_file.
    server.tool(
      "pull_file",
      "Pull a file from the Android device to the local filesystem.",
      {
        remote_path: z.string().describe("Path on the device (e.g., /sdcard/somefile.txt)"),
        local_path: z.string().describe("Local path to save the file to"),
        device_id: z.string().optional().describe("Device ID (optional if only one device)"),
      },
      async ({ remote_path, local_path, device_id }) => {
        const result = await adb.pullFile(remote_path, local_path, device_id);
        return { content: [{ type: "text", text: result.trim() || `Pulled ${remote_path} → ${local_path}` }] };
      },
    );

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/martingeidobler/android-mcp-server'

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