Skip to main content
Glama

write_file

Write a file in a WSL distribution with automatic parent directory creation, text or base64 encoding, and optional SHA-256 hash for data verification.

Instructions

Write a file in WSL. content is UTF-8 text by default; set encoding="base64" for binary content. Creates parent directories as needed. sha256=true returns a hash of the written bytes for round-trip verification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
distroNo
sha256NoReturn sha256 (hex) of the written bytes
contentYes
encodingNoDefault "text"
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses several behavioral traits: default encoding, base64 option, automatic parent directory creation, and sha256 return behavior. It does not explicitly state whether existing files are overwritten, which is a minor gap, but the provided details add substantial value beyond the schema.

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 two sentences, front-loaded with the core action, and every clause adds value. No wasted words.

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?

Given no output schema and no annotations, the description covers the essential behavior for a file-writing tool: encoding, parent dirs, and hash verification. It omits overwrite semantics and distro parameter, but overall it is sufficiently complete for an agent to invoke the tool correctly.

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 only 40%, but the description adds meaning for 'content' (UTF-8 default), 'encoding' (base64 option), 'sha256' (returns hash), and implicitly 'path' (creates parent dirs). The 'distro' parameter is not addressed, but the description compensates significantly for the low schema coverage.

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

Purpose4/5

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

The description states 'Write a file in WSL', which clearly identifies the verb (write) and resource (file in WSL). It distinguishes from read/delete tools, but does not explicitly differentiate from sibling edit_file, so a 4 is appropriate.

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?

The description provides concrete usage guidance: 'content is UTF-8 text by default; set encoding="base64" for binary content' and 'sha256=true returns a hash... for round-trip verification'. It also notes parent directory creation. However, it does not mention when to choose this over edit_file, so it misses explicit alternatives.

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/Darling209/wsl-bridge-mcp'

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