Skip to main content
Glama

Clear an app's data

android_clear_data
DestructiveIdempotent

Wipe an app's data and cache while keeping it installed, resetting it to a first-run state without uninstalling. Use to test onboarding flows or clear a corrupt database.

Instructions

Wipe an app's data and cache while leaving it installed — the equivalent of "Clear storage" in system settings.

Use this to get back to a first-run state without uninstalling. It is less disruptive than android_uninstall (the app and its install stay put) but it still destroys everything the app has stored: databases, preferences, cached files, and any signed-in session.

Args:

  • package_name (string, optional): application id to clear

  • project_path (string, optional): Gradle root; the package is resolved from it when package_name is omitted

  • module (string): module to read the package from (default: 'app')

  • serial (string, optional): target device

Returns: { "cleared": boolean, "packageName": string, "serial": string }

Examples:

  • Use when: testing onboarding or a first-run migration repeatedly

  • Use when: a corrupt local database is masking the bug you are chasing

  • Don't use when: you need the app gone entirely (use android_uninstall)

Error Handling:

  • Reports when the package is not installed

  • The app is force-stopped as a side effect; relaunch it with android_launch

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleNoGradle module that produces the APK. Almost always 'app'.app
serialNoDevice serial from android_list_devices. Optional when exactly one device is connected; required when several are.
package_nameNoApplication id whose data to clear.
project_pathNoGradle root to resolve the package from.
Behavior5/5

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

Beyond the destructiveHint=true annotation, the description spells out exactly what gets destroyed (databases, preferences, cached files, signed-in sessions), notes that the app is force-stopped as a side effect, and mentions error reporting for missing packages. This gives the agent actionable safety and side-effect knowledge that structured annotations alone do not convey.

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 well-organized into Args, Returns, Examples, and Error Handling sections, with the core purpose stated in the first sentence. Every section contributes practical information without redundancy or filler.

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

Completeness5/5

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

Although there is no output schema, the description provides the return shape ({ cleared, packageName, serial }), error handling behavior, and concrete use cases. For a destructive, state-changing tool, this level of context makes it nearly self-contained for an agent.

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

Parameters4/5

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

Schema description coverage is 100%, but the description's Args section adds a key semantic: project_path is used to resolve the package when package_name is omitted. It also restates the module default and serial's device-targeting role, which provides relational meaning beyond the raw schema.

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

Purpose5/5

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

The description opens with 'Wipe an app's data and cache while leaving it installed,' which is a specific verb+resource with clear scope. It also explicitly contrasts with android_uninstall, stating that the app and its install stay put, which definitively distinguishes it from a sibling tool.

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

Usage Guidelines5/5

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

The description gives direct usage context: 'Use this to get back to a first-run state without uninstalling,' then provides explicit 'Use when' and 'Don't use when' examples. It names the alternative android_uninstall, satisfying both when-to-use and when-not-to-use guidance.

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/jjs03111/android-build-mcp'

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