Skip to main content
Glama

install_apk

Install APK files from local storage onto Android devices using ADB commands. Specify the file path and optionally target a specific device by serial number.

Instructions

Install an APK file onto the Android device from a local file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
local_pathYesLocal filesystem path to the APK file
device_idNoDevice serial number

Implementation Reference

  • The core function that executes the ADB install command.
    export async function installApk(localPath: string, deviceId?: string): Promise<string> {
      const resolved = await deviceManager.resolveDeviceId(deviceId);
      validateLocalPath(localPath);
    
      const result = await adbExec(['install', '-r', localPath], resolved, 120000);
    
      if (result.stdout.includes('Success')) {
        log.info('APK installed', { localPath, deviceId: resolved });
        return `Successfully installed: ${localPath}`;
      }
    
      throw new Error(`APK installation failed: ${result.stdout} ${result.stderr}`);
    }
  • Registration of the install_apk tool within the MCP server.
    server.registerTool(
      'install_apk',
      {
        description: 'Install an APK file onto the Android device from a local file path.',
        inputSchema: {
          local_path: z.string().describe('Local filesystem path to the APK file'),
          device_id: z.string().optional().describe('Device serial number'),
        },
      },
      async ({ local_path, device_id }) => {
        return await metrics.measure('install_apk', device_id || 'default', async () => {
          const result = await installApk(local_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 full burden but discloses minimal behavioral traits. It doesn't state whether installation overwrites existing apps, requires debug mode, what happens if device_id is omitted (default device selection), or describe success/failure indicators for this mutation operation.

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

Conciseness4/5

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

Single sentence that is front-loaded with the action and contains no redundant or wasted words. However, the brevity borders on under-specification given the lack of annotations and output schema, though this primarily impacts completeness rather than conciseness of the existing text.

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 mutation operation (installing apps) with no annotations and no output schema, the description is insufficient. It lacks critical context: error handling behavior, prerequisites (developer mode, APK signatures), side effects (app replacement vs fresh install), and return value semantics.

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%, establishing a baseline of 3. The description mentions 'local file path' which aligns with the local_path parameter, but adds no semantic details beyond the schema such as path format requirements, APK validation, or device_id selection behavior when multiple devices are connected.

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 uses specific verb 'Install' and resource 'APK file' with clear scope ('onto the Android device'). It implicitly distinguishes from siblings like push_file by specifying 'APK' and 'Install' versus generic file transfer, though it doesn't explicitly name alternatives.

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 guidance on when to use this tool versus push_file (which transfers files without installing) or prerequisites like device connectivity/APK compatibility. No mention of when installation might fail or require specific permissions.

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