Skip to main content
Glama
charlesmuchene

Android Preference Editor MCP Server

devices

List connected Android devices to identify targets for preference editing during app development.

Instructions

Lists connected Android devices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'devices' tool. It asynchronously lists connected Android devices using the imported listDevices function, maps each device's serial to a text content block, and handles errors by returning an error message.
    server.tool("devices", "Lists connected Android devices", async () => { try { return { content: (await listDevices()).map((device) => ({ type: "text", text: device.serial, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } });
  • The 'devices' tool is registered here within the configureCommonTools function using server.tool(). This registration includes the description and the inline handler.
    server.tool("devices", "Lists connected Android devices", async () => { try { return { content: (await listDevices()).map((device) => ({ type: "text", text: device.serial, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } });
  • DeviceSchema defines the input structure for tools that interact with a specific Android device, using deviceId (serial number), which is relevant to the 'devices' tool that lists such serials.
    export const DeviceSchema = z.object({ deviceId: z.string().describe("The device's serial number."), });
  • src/index.ts:21-22 (registration)
    configureCommonTools(server) is called here, which in turn registers the 'devices' tool.
    configurePreferenceTools(server); configureCommonTools(server);

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