Skip to main content
Glama

adb_push_file

Transfer files from your computer to an Android device using the Android Debug Bridge (ADB). Specify local and remote file paths to move data to the device.

Instructions

Push a file from local system to device

Input Schema

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

Implementation Reference

  • The main handler function for adb_push_file tool. Executes adb push command using AdbClient after checking device connection.
    async pushFile(localPath: string, remotePath: string, deviceId?: string) {
      try {
        const connected = await this.adbClient.isDeviceConnected(deviceId);
        if (!connected) {
          return {
            success: false,
            error: 'Device not connected',
            message: 'Cannot push file - device is not connected'
          };
        }
    
        const command = `push "${localPath}" "${remotePath}"`;
        const result = await this.adbClient.executeCommand(command, deviceId);
        
        if (!result.success) {
          return {
            success: false,
            error: result.error,
            message: 'Failed to push file'
          };
        }
    
        return {
          success: true,
          data: { 
            localPath,
            remotePath,
            deviceId: deviceId || this.adbClient.getDefaultDevice()
          },
          message: `File pushed from ${localPath} to ${remotePath}`
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          message: 'Failed to push file'
        };
      }
    }
  • Tool schema definition including input schema for parameters: localPath (required), remotePath (required), deviceId (optional). Part of tool registration list.
    {
      name: 'adb_push_file',
      description: 'Push a file from local system to device',
      inputSchema: {
        type: 'object',
        properties: {
          localPath: {
            type: 'string',
            description: 'Local file path',
          },
          remotePath: {
            type: 'string',
            description: 'Remote file path on device',
          },
          deviceId: {
            type: 'string',
            description: 'Device ID (optional)',
          },
        },
        required: ['localPath', 'remotePath'],
      },
    },
  • src/index.ts:465-466 (registration)
    Registration in the tool dispatch switch statement, calling the FileTools.pushFile handler.
    case 'adb_push_file':
      return await this.handleToolCall(this.fileTools.pushFile(args?.localPath as string, args?.remotePath 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 the full burden of behavioral disclosure. It states the action (push) but doesn't mention whether this requires specific permissions, what happens if the file already exists at the remote path (overwrite?), error conditions, or any rate limits. For a file transfer operation with zero annotation coverage, this leaves significant behavioral 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 extremely concise - a single sentence that directly states the tool's function without any wasted words. It's front-loaded with the core action and avoids unnecessary elaboration, making it easy to parse quickly.

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 explain what happens on success/failure, return values, or important behavioral aspects like overwrite behavior. While the schema covers parameters well, the overall context for using this tool effectively is incomplete.

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?

The description doesn't add any parameter-specific information beyond what's already in the schema, which has 100% coverage with clear descriptions for all three parameters. The baseline is 3 when schema coverage is high, and the description doesn't compensate with additional context about parameter usage or constraints.

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 ('push a file') and resources involved ('from local system to device'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling 'adb_pull_file' which performs the inverse operation, though the directionality is implied. The description avoids tautology by not just restating the tool name.

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?

The description provides no guidance on when to use this tool versus alternatives. While it's obvious this is for file transfer to a device, there's no mention of prerequisites (like needing a connected device), comparison to other file operations, or when not to use it (e.g., for pulling files). The context is implied but not explicitly stated.

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