Skip to main content
Glama

mobile_device_manager

Manage mobile devices for development: list available devices, recommend optimal options, or ensure devices are ready for testing.

Instructions

Smart device management: list all, recommend best, auto-start if needed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction to performrecommend
platformNoTarget platformany

Implementation Reference

  • The core handler function implementing mobile_device_manager. It supports actions 'list', 'recommend', and 'ensure' for managing devices and emulators using composed Flutter tools.
    handler: async (args: any) => {
      const devices = [];
      const emulators = [];
      
      // Get all available devices
      const flutterDevices = await flutterTools.get('flutter_list_devices').handler({});
      if (flutterDevices.success) {
        devices.push(...(flutterDevices.data?.devices || []));
      }
      
      // Get available emulators
      const flutterEmulators = await flutterTools.get('flutter_list_emulators').handler({});
      if (flutterEmulators.success) {
        emulators.push(...(flutterEmulators.data?.emulators || []));
      }
      
      if (args.action === 'list') {
        return {
          success: true,
          data: { devices, emulators }
        };
      }
      
      if (args.action === 'recommend') {
        // Recommendation logic
        const recommendations = [];
        
        // Physical devices are usually preferred
        const physicalDevices = devices.filter((d: any) => !d.emulator);
        if (physicalDevices.length > 0) {
          recommendations.push({
            device: physicalDevices[0],
            reason: 'Physical device - best performance and real-world testing'
          });
        }
        
        // Running emulators
        const runningEmulators = devices.filter((d: any) => d.emulator);
        if (runningEmulators.length > 0) {
          recommendations.push({
            device: runningEmulators[0],
            reason: 'Emulator already running - ready to use'
          });
        }
        
        // Available emulators to start
        if (emulators.length > 0) {
          recommendations.push({
            emulator: emulators[0],
            reason: 'Emulator available - can be started on demand'
          });
        }
        
        return {
          success: true,
          data: {
            recommendations,
            bestOption: recommendations[0]
          }
        };
      }
      
      if (args.action === 'ensure') {
        // Ensure at least one device is available
        if (devices.length > 0) {
          return {
            success: true,
            data: {
              device: devices[0],
              message: 'Device already available'
            }
          };
        }
        
        // Try to start an emulator
        if (emulators.length > 0) {
          const launchResult = await flutterTools.get('flutter_launch_emulator').handler({
            emulatorId: emulators[0].id
          });
          
          return {
            success: launchResult.success,
            data: {
              emulator: emulators[0],
              launchResult,
              message: 'Started emulator'
            }
          };
        }
        
        return {
          success: false,
          error: 'No devices or emulators available'
        };
      }
    
      // Default return for unknown action
      return {
        success: false,
        error: `Unknown action: ${args.action}`
      };
    }
  • Input schema defining parameters for the mobile_device_manager tool: action (list/recommend/ensure) and platform filter.
    inputSchema: {
      type: 'object',
      properties: {
        action: {
          type: 'string',
          enum: ['list', 'recommend', 'ensure'],
          description: 'Action to perform',
          default: 'recommend'
        },
        platform: {
          type: 'string',
          enum: ['android', 'ios', 'any'],
          description: 'Target platform',
          default: 'any'
        }
      }
    },
  • Local registration of the mobile_device_manager tool within the createSuperTools function's tools Map.
    tools.set('mobile_device_manager', {
      name: 'mobile_device_manager',
      description: 'Smart device management: list all, recommend best, auto-start if needed',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['list', 'recommend', 'ensure'],
            description: 'Action to perform',
            default: 'recommend'
          },
          platform: {
            type: 'string',
            enum: ['android', 'ios', 'any'],
            description: 'Target platform',
            default: 'any'
          }
        }
      },
      handler: async (args: any) => {
        const devices = [];
        const emulators = [];
        
        // Get all available devices
        const flutterDevices = await flutterTools.get('flutter_list_devices').handler({});
        if (flutterDevices.success) {
          devices.push(...(flutterDevices.data?.devices || []));
        }
        
        // Get available emulators
        const flutterEmulators = await flutterTools.get('flutter_list_emulators').handler({});
        if (flutterEmulators.success) {
          emulators.push(...(flutterEmulators.data?.emulators || []));
        }
        
        if (args.action === 'list') {
          return {
            success: true,
            data: { devices, emulators }
          };
        }
        
        if (args.action === 'recommend') {
          // Recommendation logic
          const recommendations = [];
          
          // Physical devices are usually preferred
          const physicalDevices = devices.filter((d: any) => !d.emulator);
          if (physicalDevices.length > 0) {
            recommendations.push({
              device: physicalDevices[0],
              reason: 'Physical device - best performance and real-world testing'
            });
          }
          
          // Running emulators
          const runningEmulators = devices.filter((d: any) => d.emulator);
          if (runningEmulators.length > 0) {
            recommendations.push({
              device: runningEmulators[0],
              reason: 'Emulator already running - ready to use'
            });
          }
          
          // Available emulators to start
          if (emulators.length > 0) {
            recommendations.push({
              emulator: emulators[0],
              reason: 'Emulator available - can be started on demand'
            });
          }
          
          return {
            success: true,
            data: {
              recommendations,
              bestOption: recommendations[0]
            }
          };
        }
        
        if (args.action === 'ensure') {
          // Ensure at least one device is available
          if (devices.length > 0) {
            return {
              success: true,
              data: {
                device: devices[0],
                message: 'Device already available'
              }
            };
          }
          
          // Try to start an emulator
          if (emulators.length > 0) {
            const launchResult = await flutterTools.get('flutter_launch_emulator').handler({
              emulatorId: emulators[0].id
            });
            
            return {
              success: launchResult.success,
              data: {
                emulator: emulators[0],
                launchResult,
                message: 'Started emulator'
              }
            };
          }
          
          return {
            success: false,
            error: 'No devices or emulators available'
          };
        }
    
        // Default return for unknown action
        return {
          success: false,
          error: `Unknown action: ${args.action}`
        };
      }
    });
  • src/server.ts:61-71 (registration)
    Top-level registration loop in the MCP server that adds mobile_device_manager (from superTools) to the server's main tools Map if present in TOOL_REGISTRY.
    for (const toolName of Object.keys(TOOL_REGISTRY)) {
      if (allAvailableTools.has(toolName)) {
        tools.set(toolName, allAvailableTools.get(toolName));
      } else if (toolName === 'health_check') {
        // health_check is handled separately below
        continue;
      } else {
        // Tool is in registry but not implemented - log warning
        console.warn(`Warning: Tool '${toolName}' is in TOOL_REGISTRY but not implemented`);
      }
    }
  • Metadata entry in TOOL_REGISTRY for mobile_device_manager, used for health checks and tool discovery.
    'mobile_device_manager': {
      name: 'mobile_device_manager',
      category: ToolCategory.ESSENTIAL,
      platform: 'cross-platform',
      requiredTools: [RequiredTool.FLUTTER],
      description: 'Smart device management: list all, recommend best, auto-start if needed',
      safeForTesting: false,
      performance: { expectedDuration: 30000, timeout: 180000 }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'auto-start if needed' which hints at a potential mutation (starting devices), but doesn't disclose behavioral traits like permissions required, side effects, rate limits, or what 'recommend best' entails. For a tool with actions that could include mutations (ensure/auto-start), this lack of transparency is a significant gap.

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?

The description is very concise with a single phrase listing three actions, which is efficient and front-loaded. However, it could be more structured by separating the actions or providing slight elaboration. There's no wasted text, but it borders on being too terse for a tool with multiple functionalities.

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 complexity (multiple actions including potential mutations), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'recommend best' means, what 'auto-start if needed' entails, or how results are returned. For a tool that could perform different operations, more context is needed to guide the agent effectively.

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%, with both parameters (action and platform) well-documented in the schema including enums and defaults. The description adds no additional meaning beyond what the schema provides, such as explaining the semantics of 'ensure' or how 'recommend' works. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

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

The description states the tool performs 'smart device management' with three actions (list, recommend, auto-start), which gives a general purpose. However, it's vague about what 'smart device management' entails and doesn't clearly distinguish this tool from sibling tools like android_list_devices, flutter_list_devices, or ios_list_simulators that also list devices. The phrase 'smart device management' is somewhat ambiguous.

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. It doesn't mention any prerequisites, context for choosing between actions, or how it relates to sibling tools such as android_list_devices or flutter_list_devices. There's no explicit when/when-not usage advice, leaving the agent to infer based on the action names alone.

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/cristianoaredes/mcp-mobile-server'

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