Skip to main content
Glama
charlesmuchene

Android Preference Editor MCP Server

list_apps

Retrieve a list of apps installed on an Android device by providing the device's serial number, aiding in app development and preference management.

Instructions

Lists apps installed on device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesThe device's serial number.

Implementation Reference

  • Registers the "list_apps" MCP tool, providing description, input schema, and the handler function that executes the tool logic by listing apps on the specified device.
    server.tool( "list_apps", "Lists apps installed on device", DeviceSchema.shape, async (connection: z.infer<typeof DeviceSchema>) => { try { validate(connection, DeviceSchema); return { content: (await listApps(connection)).map((app) => ({ type: "text", text: app.packageName, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } } );
  • Zod schema definition for the input to the list_apps tool, requiring a deviceId (serial number).
    export const DeviceSchema = z.object({ deviceId: z.string().describe("The device's serial number."), });
  • The inline async handler function for the list_apps tool, which validates the device connection, calls listApps(connection) to fetch apps, and formats the package names as text content.
    async (connection: z.infer<typeof DeviceSchema>) => { try { validate(connection, DeviceSchema); return { content: (await listApps(connection)).map((app) => ({ type: "text", text: app.packageName, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } }

Other Tools

Related 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/charlesmuchene/pref-editor-mcp-server'

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