Skip to main content
Glama
charlesmuchene

Android Preference Editor MCP Server

delete_preference

Remove a specific user preference from an Android app's configuration file during development by specifying the preference name, device ID, app package, and filename.

Instructions

Delete an existing preference

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name/key of the user preference
deviceIdYesThe device's serial number.
appIdYesThe application's package name.
filenameYesThe filename with or without the extension.

Implementation Reference

  • Handler function that executes the logic for the 'delete_preference' tool: validates input, calls deletePreference, and returns response.
    async (input: z.infer<typeof DeletePrefSchema>) => {
      try {
        validate(input, DeletePrefSchema);
    
        const { name, ...connection } = input;
    
        await deletePreference({ key: name }, connection);
    
        return {
          content: [
            {
              type: "text",
              text: `Preference deleted`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: error instanceof Error ? error.message : "Unknown error",
            },
          ],
        };
      }
  • Zod schema definition for delete_preference input: DeletePrefSchema = NameSchema.merge(FileSchema)
    export const DeletePrefSchema = NameSchema.merge(FileSchema);
  • Registration of the 'delete_preference' tool on the MCP server using server.tool(name, description, schema, handler).
    server.tool(
      "delete_preference",
      "Delete an existing preference",
      DeletePrefSchema.shape,
      async (input: z.infer<typeof DeletePrefSchema>) => {
        try {
          validate(input, DeletePrefSchema);
    
          const { name, ...connection } = input;
    
          await deletePreference({ key: name }, connection);
    
          return {
            content: [
              {
                type: "text",
                text: `Preference deleted`,
              },
            ],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: error instanceof Error ? error.message : "Unknown error",
              },
            ],
          };
        }
      }
    );
  • Utility function 'validate' used in the handler to parse and validate input against the tool's Zod schema.
    export const validate = (input: unknown, type: ZodType) => {
      const validationResult = type.safeParse(input);
      if (!validationResult.success)
        throw new Error(
          `Invalid input: ${validationResult.error.errors
            .map((err) => err.message)
            .join(", ")}`
        );
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive mutation, it doesn't specify whether this operation is reversible, what permissions are required, or what happens on success/failure. For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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 appropriately sized for a simple tool and front-loads the core action ('Delete'), making it easy to scan and understand quickly.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address critical context like what happens after deletion (e.g., confirmation, error handling), whether the operation is idempotent, or how it relates to sibling tools. The 100% schema coverage helps with parameters but doesn't compensate for the lack of behavioral and contextual information.

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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional meaning about the parameters beyond what's already in the schema (e.g., it doesn't explain how 'name', 'deviceId', 'appId', and 'filename' together identify a specific preference). Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Delete') and the resource ('an existing preference'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'change_preference' or 'add_preference' in terms of what specific type of preference operation it performs, which prevents a perfect 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 'change_preference' or 'add_preference'. It doesn't mention prerequisites (e.g., that a preference must exist first) or contextual constraints, leaving the agent with minimal usage direction.

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