Skip to main content
Glama
TiagoDanin

Android Debug Bridge MCP

by TiagoDanin

list_apps

Find installed Android applications by searching for specific name patterns in app packages to identify and manage apps on connected devices.

Instructions

List installed apps matching a name pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_nameYesName pattern to search for in app packages

Implementation Reference

  • The main handler function for the 'list_apps' tool. It takes an 'app_name' argument, runs an ADB command to list matching packages using 'pm list packages | findstr', and returns the result as a text content block.
    list_apps: async (args: any) => {
      const { app_name } = args as { app_name: string };    
      const result = await executeCommand(`adb shell pm list packages | findstr "${app_name}"`);
      
      return {
        content: [
          {
            type: 'text',
            text: result || 'No apps found matching the pattern',
          },
        ],
      };
    },
  • The JSON schema definition for the 'list_apps' tool, specifying the required 'app_name' string input.
      name: 'list_apps',
      description: 'List installed apps matching a name pattern',
      inputSchema: {
        type: 'object',
        properties: {
          app_name: {
            type: 'string',
            description: 'Name pattern to search for in app packages',
          },
        },
        required: ['app_name'],
      },
    },
  • src/index.ts:32-46 (registration)
    The MCP server request handler for calling tools (CallToolRequestSchema), which dispatches to the specific tool handler like 'list_apps' based on the 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}`);
      }
    });
  • src/index.ts:26-30 (registration)
    The MCP server request handler for listing tools (ListToolsRequestSchema), which returns all tool definitions including 'list_apps'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: toolDefinitions,
      };
    });

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