Skip to main content
Glama

android-file

Perform file operations on Android devices: list directories, push/pull files, delete, create folders, check existence, read and write file content, and view file statistics using a single command.

Instructions

Perform file and directory operations on an Android device.

This single tool consolidates various file system actions. The 'action' parameter determines the operation.

Args: serial: Device serial number. action: The specific file operation to perform. See available actions below. ctx: MCP Context for logging and interaction. path (Optional[str]): General path argument on the device. Used by: list_directory, delete_file, create_directory, file_exists, file_stats. Can also be used by read_file and write_file as an alternative to 'device_path'. local_path (Optional[str]): Path on the DroidMind server machine. Used by: push_file (source), pull_file (destination). device_path (Optional[str]): Path on the Android device. Used by: push_file (destination), pull_file (source), read_file (source), write_file (destination). If 'path' is also provided for read/write, 'device_path' takes precedence. content (Optional[str]): Text content to write. Used by: write_file. max_size (Optional[int]): Maximum file size in bytes for read_file (default: 100KB). Used by: read_file.

Returns: Union[str, bool]: A string message indicating the result or status for most actions. Returns a boolean for the 'file_exists' action.


Available Actions and their specific argument usage:

  1. action="list_directory": Lists contents of a directory.

    • Requires: path (directory path on device).

    • Returns: Formatted string of directory contents.

  2. action="push_file": Uploads a file from the local server to the device.

    • Requires: local_path (source on server), device_path (destination on device).

    • Returns: String message confirming upload.

  3. action="pull_file": Downloads a file from the device to the local server.

    • Requires: device_path (source on device), local_path (destination on server).

    • Returns: String message confirming download.

  4. action="delete_file": Deletes a file or directory from the device.

    • Requires: path (path to delete on device).

    • Returns: String message confirming deletion.

  5. action="create_directory": Creates a directory on the device.

    • Requires: path (directory path to create on device).

    • Returns: String message confirming creation.

  6. action="file_exists": Checks if a file or directory exists on the device.

    • Requires: path (path to check on device).

    • Returns: True if exists, False otherwise.

  7. action="read_file": Reads the contents of a file from the device.

    • Requires: device_path (or path) for the file on device.

    • Optional: max_size (defaults to 100KB).

    • Returns: String containing file contents or error message.

  8. action="write_file": Writes text content to a file on the device.

    • Requires: device_path (or path) for the file on device, content (text to write).

    • Returns: String message confirming write.

  9. action="file_stats": Gets detailed statistics for a file or directory.

    • Requires: path (path on device).

    • Returns: Markdown-formatted string of file/directory statistics.


Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialYes
actionYes
pathNo
local_pathNo
device_pathNo
contentNo
max_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description fully covers behavior: explains each action, parameter precedence (device_path over path), defaults (max_size=100KB), and return types. Destructive operations are implied by action names.

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

Conciseness4/5

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

Well-structured with sections and bullet points, front-loaded with purpose. Slightly verbose due to repeated 'Used by' lines, but every sentence adds value for an agent.

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?

Given 7 parameters, 2 required, no annotations, and an output schema exists, the description provides complete guidance for all actions, including parameter mapping and return types, ensuring correct invocation.

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

Parameters5/5

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

Schema has 0% parameter descriptions; description compensates thoroughly by explaining each parameter's purpose, which actions use them, precedence rules, and defaults, adding significant meaning beyond the 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?

Description clearly states it performs file and directory operations on an Android device, listing 9 distinct actions, which differentiates it from sibling tools like android-app or android-shell.

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

Usage Guidelines3/5

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

Usage context is implied through action descriptions, but no explicit guidance on when to use this tool versus alternatives (e.g., android-shell for commands) or when not to use it.

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/hyperb1iss/droidmind'

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