Write file
write_file
WriteFileTool — write content to a file.
Registered as write_file via the axm.tools entry point.
WriteFileTool
Write content to a file, creating parent directories.
Simple single-file write for AI agents. For atomic multi-file
operations, use :class:BatchEditTool instead.
Registered as write_file via axm.tools entry point.
Source code in packages/axm-edit/src/axm_edit/tools/write_file.py
name
property
Tool name used for MCP registration.
execute(*, path=None, content=None, **kwargs)
Write content to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | None
|
Absolute path to the file to write. |
None
|
content
|
str | None
|
Text content to write. |
None
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with written file path and byte count. |
Source code in packages/axm-edit/src/axm_edit/tools/write_file.py
render_text(*, path, byte_count)
Render a compact, git-style LLM-facing view of a write result.
The header carries the global status (✓) plus the written path and
its exact byte count. Both values mirror data verbatim — only the
JSON structure (braces, quotes, keys) is dropped, so no information is
lost relative to data.