Skip to main content
Glama

write_file

Write text content to any Android device file by pushing a temporary file, safely handling content that shell echo cannot. Optionally push as root into protected paths and return status, remote path, and byte count.

Instructions

Write text content to a device file by pushing a temp file (handles any content safely, unlike shell echo). as_root pushes to /data/local/tmp then su -c cp into place. Returns {status, remote, bytes}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remoteYes
serialNo
as_rootNo
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does disclose real behavior: the temp-file push mechanism, the elevated path (/data/local/tmp + su -c cp), and the return shape. It omits overwrite/truncate semantics, permission prerequisites, and whether parent directories are created — gaps for a mutation tool, but the mechanism disclosure is well above average.

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 tight sentences: the primary action and its rationale come first, the as_root special case second, the return shape last. Zero filler.

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?

The return shape ({status, remote, bytes}) is covered by the output schema, and the description correctly focuses on mechanism rather than repeating it. Given no annotations and 0% schema coverage, it is nearly complete, with the only real hole being overwrite/failure behavior.

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 coverage is 0%, so the description must compensate. It explains `content` and `as_root` meaningfully and implies `remote` is the target device file, but `serial` is never addressed and no parameter takes format/syntax detail. Partial compensation for a four-parameter tool.

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?

States a specific verb and resource ('Write text content to a device file') and immediately distinguishes itself from the closest overlapping approach ('handles any content safely, unlike shell echo'). An agent can tell this apart from run_shell-echo or a raw push without opening the schema.

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

Usage Guidelines4/5

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

Explains the context in which it is preferable (safe handling of arbitrary content vs shell echo) and describes the as_root variant's behavior. It stops short of naming an explicit alternative tool (e.g. push) or stating when not to use it, so it is clear but not fully routed.

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