Skip to main content
Glama

open_app

Launch Android applications by specifying their package name, enabling automated app testing and device control through ADB commands.

Instructions

Open an app using its package name and activity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYesFull package name of the app (e.g., com.example.app)

Implementation Reference

  • The main handler function for the 'open_app' tool. It extracts the package_name from args, runs 'adb shell monkey -p {package_name} 1' to launch the app, sleeps for 5 seconds, and returns a text confirmation.
    open_app: async (args: any) => { const { package_name } = args as { package_name: string; }; await executeCommand(`adb shell monkey -p ${package_name} 1`); await sleep(5000); return { content: [ { type: 'text', text: `App opened: ${package_name}`, }, ], }; },
  • The schema definition for the 'open_app' tool, specifying the input schema that requires a 'package_name' string.
    { name: 'open_app', description: 'Open an app using its package name and activity', inputSchema: { type: 'object', properties: { package_name: { type: 'string', description: 'Full package name of the app (e.g., com.example.app)', }, }, required: ['package_name'], }, },
  • src/index.ts:26-30 (registration)
    Registration of tool list handler, which returns all tool definitions including 'open_app' schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions, }; });
  • src/index.ts:32-46 (registration)
    Registration of tool call handler, which dispatches to the specific tool handler like 'open_app' based on name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const handler = toolHandlers[name as keyof typeof toolHandlers]; if (!handler) { throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); } return await handler(args); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${errorMessage}`); } });

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/TiagoDanin/Android-Debug-Bridge-MCP'

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