Skip to main content
Glama

adb_file_replace

Replace text in Android device files safely. Supports global or line-targeted edits, optional backups, and root access.

Instructions

Find and replace text in a file on the device. Uses sed internally with proper escaping — exposes a safe interface without requiring sed syntax knowledge. Supports global replacement, line-targeted edits, and optional backup creation. Reports match count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path on device
findYesText to find (literal string, not regex)
replaceYesReplacement text
globalNoReplace all occurrences (default: true). Set false for first-only.
lineNumberNoRestrict replacement to a specific line number
backupNoCreate a .bak backup before modifying
rootNoUse root shell for protected paths
deviceNoDevice serial
Behavior3/5

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

No annotations provided, so description carries burden. Notes internal sed usage with proper escaping, reports match count, and mentions backup option. However, does not disclose error handling (e.g., missing file, permission failures) or state that file is modified in place. Moderate disclosure.

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?

Three sentences, no redundancy. Front-loaded with primary action, followed by implementation detail, features, and output. Every sentence earns its place.

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

Completeness4/5

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

With 8 parameters and no output schema, description covers core use, features, and output (match count). Missing mention of device parameter necessity and error cases, but overall adequate for a text replacement tool. Slightly above minimum.

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 coverage is 100%, baseline 3. Description adds value by explicitly tying global and lineNumber to 'global replacement' and 'line-targeted edits', and notes match count output. This goes beyond schema descriptions, providing usage context for key parameters.

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?

Clearly states 'Find and replace text in a file on the device' with specific verb and resource. Distinguishes from siblings like adb_grep (search only) and adb_file_write (write arbitrary content). Mentions internal use of sed with safe interface, further clarifying purpose.

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?

Implicitly describes when to use (for text replacement) but does not explicitly contrast with alternatives like adb_grep or adb_file_write. No guidance on when not to use or prerequisites. Adequate but lacks comparative context.

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/fullread/DeepADB'

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