Skip to main content
Glama

get_device_info

Retrieve detailed Android device specifications including model, Android version, SDK version, screen size, brand, and manufacturer for connected devices.

Instructions

Get detailed information about a connected Android device including model, Android version, SDK version, screen size, brand, and manufacturer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idNoDevice serial number. If omitted, uses the only connected device.

Implementation Reference

  • The core logic for gathering device information using ADB shell commands.
    async getDeviceInfo(deviceId?: string): Promise<DeviceInfo> {
      const resolvedId = await this.resolveDeviceId(deviceId);
    
      const [modelResult, versionResult, sdkResult, sizeResult, brandResult, mfgResult] = await Promise.all([
        adbShell(['getprop', 'ro.product.model'], resolvedId),
        adbShell(['getprop', 'ro.build.version.release'], resolvedId),
        adbShell(['getprop', 'ro.build.version.sdk'], resolvedId),
        adbShell(['wm', 'size'], resolvedId),
        adbShell(['getprop', 'ro.product.brand'], resolvedId),
        adbShell(['getprop', 'ro.product.manufacturer'], resolvedId),
      ]);
    
      // Parse screen size: "Physical size: 1080x1920"
      const sizeMatch = sizeResult.stdout.match(/(\d+)x(\d+)/);
      const screenWidth = sizeMatch ? parseInt(sizeMatch[1], 10) : undefined;
      const screenHeight = sizeMatch ? parseInt(sizeMatch[2], 10) : undefined;
    
      const info: DeviceInfo = {
        id: resolvedId,
        status: 'device',
        model: modelResult.stdout.trim(),
        androidVersion: versionResult.stdout.trim(),
        sdkVersion: sdkResult.stdout.trim(),
        screenWidth,
        screenHeight,
        brand: brandResult.stdout.trim(),
        manufacturer: mfgResult.stdout.trim(),
      };
    
      // Cache screen size in session
      if (screenWidth && screenHeight) {
        this.updateSession(resolvedId, screenWidth, screenHeight);
      }
    
      return info;
    }
  • Registration of the 'get_device_info' MCP tool, which invokes the DeviceManager handler.
    server.registerTool(
      'get_device_info',
      {
        description: 'Get detailed information about a connected Android device including model, Android version, SDK version, screen size, brand, and manufacturer',
        inputSchema: {
          device_id: z.string().optional().describe('Device serial number. If omitted, uses the only connected device.'),
        },
      },
      async ({ device_id }) => {
        return await metrics.measure('get_device_info', device_id || 'default', async () => {
          const info = await deviceManager.getDeviceInfo(device_id);
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({ success: true, device: info }, null, 2),
            }],
          };
        });
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden. It compensates partially by listing specific return fields (model, Android version, etc.) since no output schema exists, but fails to disclose safety properties (read-only vs destructive), error conditions (what if device_id is invalid?), or side effects.

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 that front-loads the action verb and immediately specifies the resource and return attributes. No words are wasted, and the structure is appropriately dense for the tool's simplicity.

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

Completeness4/5

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

Given the tool's low complexity (one optional parameter) and lack of output schema, the description appropriately compensates by enumerating the specific device attributes returned. It could be improved by noting error conditions (e.g., device not connected) or relationships to list_devices, but is sufficient for correct invocation.

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?

With 100% schema description coverage for the single optional parameter, the schema adequately documents the device_id parameter and its default behavior. The description adds no additional parameter semantics, meeting the baseline expectation for high-coverage schemas.

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

Purpose5/5

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

The description uses a specific verb ('Get') and resource ('connected Android device'), and distinguishes from siblings like get_device_state and get_screen_size by enumerating specific static fields returned (model, Android version, SDK version, etc.), clarifying this retrieves hardware/software metadata.

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 like list_devices (which likely enumerates available devices first) or get_device_state (which probably returns dynamic runtime data). It does not mention that device_id can be obtained from list_devices or prerequisites for use.

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