Skip to main content
Glama
charlesmuchene

Android Preference Editor MCP Server

list_files

Lists preference files for an Android app using device ID and app package name, aiding developers in efficient preference management during app development.

Instructions

Lists preference files for an app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe application's package name.
deviceIdYesThe device's serial number.

Implementation Reference

  • The handler function that executes the list_files tool logic: validates input, lists files using listFiles(connection), formats as text list, handles errors.
    async (connection: z.infer<typeof AppSchema>) => { try { validate(connection, AppSchema); return { content: (await listFiles(connection)).map((file) => ({ type: "text", text: file.name, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } }
  • Registers the list_files tool on the MCP server with name, description, AppSchema.shape as input schema, and inline handler.
    server.tool( "list_files", "Lists preference files for an app", AppSchema.shape, async (connection: z.infer<typeof AppSchema>) => { try { validate(connection, AppSchema); return { content: (await listFiles(connection)).map((file) => ({ type: "text", text: file.name, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } } );
  • Input schema for list_files tool: requires deviceId and appId.
    export const AppSchema = DeviceSchema.extend({ appId: z.string().describe("The application's package name."), });
  • src/index.ts:21-22 (registration)
    Invokes configureCommonTools which includes registration of list_files tool.
    configurePreferenceTools(server); configureCommonTools(server);

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