Skip to main content
Glama

push_file

Upload files from your computer to an Android device using ADB commands. Specify local file path, destination on device, and device ID to transfer data.

Instructions

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

Input Schema

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

Implementation Reference

  • The core logic implementation for pushing a file to a device.
    export async function pushFile(
      localPath: string,
      remotePath: string,
      deviceId?: string
    ): Promise<string> {
      const resolved = await deviceManager.resolveDeviceId(deviceId);
      validateLocalPath(localPath);
      const validRemote = validateDevicePath(remotePath);
    
      const result = await adbExec(['push', localPath, validRemote], resolved, 60000);
    
      log.info('File pushed', { localPath, remotePath: validRemote, deviceId: resolved });
      return `${result.stdout}\n${result.stderr}`.trim();
    }
  • MCP tool registration and handler wrapper for 'push_file'.
    server.registerTool(
      'push_file',
      {
        description: 'Upload a file from the local machine to the Android device.',
        inputSchema: {
          local_path: z.string().describe('Local filesystem path of the file to upload'),
          remote_path: z.string().describe('Absolute path on the Android device to save to'),
          device_id: z.string().optional().describe('Device serial number'),
        },
      },
      async ({ local_path, remote_path, device_id }) => {
        return await metrics.measure('push_file', device_id || 'default', async () => {
          const result = await pushFile(local_path, remote_path, device_id);
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({ success: true, message: result }, null, 2),
            }],
          };
        });
      }
    );
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 'Upload' implying a write operation, but fails to disclose critical behavioral traits such as whether existing files are overwritten, if parent directories are created automatically, or what error conditions might occur.

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, efficient sentence of ten words. Every word contributes essential information (action, resource, source, destination) with no redundancy or filler content, and the action is front-loaded.

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

Completeness3/5

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

For a three-parameter file transfer operation with no output schema and no annotations, the description meets minimum viability by identifying the core operation and endpoints. However, it lacks important context for a destructive-capable operation (overwrite behavior, return value) that would be necessary for robust agent usage.

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 input schema has 100% description coverage for all three parameters (local_path, remote_path, device_id), establishing a baseline score of 3. The description adds directional context ('from local machine to Android') but does not provide additional syntax constraints, validation rules, or examples beyond what the schema already documents.

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 verb (upload), resource (file), and directionality (local machine to Android device). However, it does not explicitly distinguish from the sibling tool `pull_file` by name or explicitly contrast the upload vs download directions, only implying it through prepositions.

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 explicit guidance on when to use this tool versus alternatives (e.g., `pull_file` for the reverse direction), nor does it mention prerequisites such as requiring a connected device or existing parent directories on the remote path.

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

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