Skip to main content
Glama

adb_set_default_device

Set the default Android device for ADB operations to streamline device management and automation tasks.

Instructions

Set the default device for subsequent operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesDevice ID to set as default

Implementation Reference

  • The primary handler function for the 'adb_set_default_device' tool. It checks if the specified device is connected, sets it as the default using AdbClient, and returns a structured response.
    async setDefaultDevice(deviceId: string) {
      try {
        const connected = await this.adbClient.isDeviceConnected(deviceId);
        if (!connected) {
          return {
            success: false,
            error: 'Device not connected',
            message: 'Cannot set default device - device is not connected'
          };
        }
    
        this.adbClient.setDefaultDevice(deviceId);
        return {
          success: true,
          data: { deviceId },
          message: `Default device set to ${deviceId}`
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          message: 'Failed to set default device'
        };
      }
    }
  • Input schema definition for the tool, specifying that 'deviceId' is required.
    {
      name: 'adb_set_default_device',
      description: 'Set the default device for subsequent operations',
      inputSchema: {
        type: 'object',
        properties: {
          deviceId: {
            type: 'string',
            description: 'Device ID to set as default',
          },
        },
        required: ['deviceId'],
      },
    },
  • src/index.ts:437-438 (registration)
    Registers the tool handler in the switch statement for CallToolRequestSchema, delegating to deviceTools.setDefaultDevice.
    case 'adb_set_default_device':
      return await this.handleToolCall(this.deviceTools.setDefaultDevice(args?.deviceId as string));
  • Helper method in AdbClient that sets the defaultDevice property, used by all subsequent ADB commands to target the correct device.
    setDefaultDevice(deviceId: string): void {
      this.defaultDevice = deviceId;
    }
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 tool sets a default device but fails to explain critical behaviors like whether this is a persistent setting across sessions, if it requires specific permissions, what happens on invalid device IDs, or error handling. This leaves significant gaps for a mutation tool.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it highly concise and well-structured for quick understanding.

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?

Given the tool's mutation nature, lack of annotations, and no output schema, the description is insufficient. It doesn't cover behavioral aspects like persistence, error cases, or impact on sibling tools, leaving the agent with incomplete context for safe and effective use.

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, with the 'deviceId' parameter clearly documented. The description doesn't add any extra meaning beyond the schema, such as format examples or constraints, but the schema provides adequate baseline information, justifying a score of 3.

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 ('Set') and resource ('default device for subsequent operations'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from its siblings like 'adb_list_devices' or explain what 'subsequent operations' refers to in the context of ADB tools, which prevents a perfect score.

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, such as whether it should be called before other ADB operations or if it's optional. It mentions 'subsequent operations' but doesn't specify which tools are affected, leaving usage context vague and incomplete.

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