Skip to main content
Glama
riparino

@modelcontextprotocol/server-wsl

by riparino

write_file

Write or overwrite a file in the WSL filesystem with provided content, creating the file if needed. Requires the parent directory to exist.

Instructions

Write or overwrite a file in the WSL filesystem with the provided content. Creates the file if it does not exist; overwrites it if it does. The parent directory must already exist. Use run_command with mkdir -p to create missing directories first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path where the file should be written within the WSL filesystem, e.g. '/home/user/project/script.sh'.
distroNoName of the WSL distribution. Defaults to the system default distribution.
contentYesThe UTF-8 text content to write to the file.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool creates or overwrites files, requires an existing parent directory, and writes UTF-8 text. It does not cover error cases like permissions or disk space, but for a file write tool the core behaviors are transparent.

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: the first states the primary action, the second provides a precondition and alternative. Every sentence adds value without unnecessary text. The critical information is front-loaded.

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 the tool's complexity (3 params, no output schema), the description covers the main purpose, preconditions, and usage context. It mentions the WSL filesystem and UTF-8 encoding. Minor gaps: no mention of return value or error handling, but adequate for basic use.

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?

The schema has 100% coverage with descriptions for all three parameters. The description adds value by specifying that the path must be absolute within the WSL filesystem and that content is UTF-8 text, and reiterates the parent directory constraint.

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?

The description clearly states the verb 'Write or overwrite' and the resource 'file in the WSL filesystem'. It distinguishes from siblings by specifying writing versus reading (read_file) or command execution (run_command). The create/overwrite behavior is explicitly noted.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use (writing files), a key prerequisite (parent directory must exist), and a direct alternative ('Use run_command with mkdir -p to create missing directories first'). This offers clear guidance for proper invocation.

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

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