Skip to main content
Glama

adb_pull_file

Transfer files from Android devices to your local system using ADB commands. Specify remote file path and optional device ID or local destination.

Instructions

Pull a file from device to local system

Input Schema

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

Implementation Reference

  • The `pullFile` method in FileTools class executes the ADB `pull` command to transfer a file from the device to the local system. It checks device connection, determines local path if not provided, runs the command via AdbClient, and returns success/error details.
    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'
        };
      }
  • The input schema definition for the 'adb_pull_file' tool, specifying parameters: remotePath (required), localPath (optional), deviceId (optional). This is part of the tool list returned by ListToolsRequest.
    {
      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)
    The switch case in the CallToolRequestHandler that registers and dispatches the 'adb_pull_file' tool call 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));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the file transfer action but lacks details on permissions required, error conditions (e.g., if file doesn't exist), whether it overwrites local files, or what happens if localPath is omitted. For a file operation tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently communicates the core functionality without any wasted words. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a file transfer tool with no annotations and no output schema, the description is insufficient. It doesn't cover what happens on success/failure, return values, error handling, or important behavioral aspects like overwrite behavior. Given the complexity of file operations and lack of structured data, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any additional meaning about parameters beyond what's in the schema (e.g., it doesn't explain format expectations or default behaviors when optional parameters are omitted). Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('pull') and resource ('file from device to local system'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling 'adb_push_file' (which performs the reverse operation), though the distinction is implied through the directionality of the action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives like 'adb_list_files' (to check what files exist) or 'adb_push_file' (for the reverse operation). The description only states what it does, not when it's appropriate or what prerequisites might be needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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