Skip to main content
Glama
charlesmuchene

Android Preference Editor MCP Server

read_preferences

Extract user preferences from Android app files to view stored settings and configuration data during development.

Instructions

Reads all user preferences in a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesThe device's serial number.
appIdYesThe application's package name.
filenameYesThe filename with or without the extension.

Implementation Reference

  • Handler function for the 'read_preferences' tool. Validates input with FileSchema, calls external readPreferences(connection), formats each preference as formatted JSON text.
    async (connection: z.infer<typeof FileSchema>) => {
      try {
        validate(connection, FileSchema);
    
        return {
          content: (await readPreferences(connection)).map((pref) => ({
            type: "text",
            mimeType: "application/json",
            text: JSON.stringify(pref, null, 2),
          })),
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: error instanceof Error ? error.message : "Unknown error",
            },
          ],
        };
      }
    }
  • Registration of the 'read_preferences' MCP tool via server.tool() call within configureCommonTools, including inline handler and FileSchema.shape as input schema.
    server.tool(
      "read_preferences",
      "Reads all user preferences in a file",
      FileSchema.shape,
      async (connection: z.infer<typeof FileSchema>) => {
        try {
          validate(connection, FileSchema);
    
          return {
            content: (await readPreferences(connection)).map((pref) => ({
              type: "text",
              mimeType: "application/json",
              text: JSON.stringify(pref, null, 2),
            })),
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: error instanceof Error ? error.message : "Unknown error",
              },
            ],
          };
        }
      }
    );
  • FileSchema Zod schema used for input validation of read_preferences tool: extends AppSchema with 'filename' field.
    export const FileSchema = AppSchema.extend({
      filename: z.string().describe("The filename with or without the extension."),
    });
  • src/index.ts:21-22 (registration)
    Invocation of configureCommonTools(server) which registers the read_preferences tool (among others).
    configurePreferenceTools(server);
    configureCommonTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation, implying safety, but doesn't cover aspects like permissions needed, error handling, rate limits, or what 'all user preferences' entails (e.g., format, scope). This leaves significant gaps for a tool with three required parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (3 required parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, output format, error cases, and how it differs from siblings. For a read operation with multiple inputs, more context is needed to ensure proper agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all three parameters (deviceId, appId, filename) with clear descriptions. The description adds no additional parameter semantics beyond implying a file-based context, which is minimal value. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Reads') and resource ('all user preferences in a file'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_files' or 'devices', which might also involve reading operations, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_files' or 'devices', nor does it mention prerequisites or exclusions. It's a basic statement of function without contextual usage advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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