Skip to main content
Glama

Write file on webspace

webspace_write_file
Destructive

Create or overwrite a file inside a webspace as its site user, jailed to the home directory. An existing file is replaced completely, so read it with webspace_read_file first when changing only part of it. Missing parent directories are created. Max 32 MB. Files under public_html are live on the website at once. For a VPS use vps_write_file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "webspace_write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe webspace ID
pathYesPath relative to the webspace's home directory, or absolute under /home/<user>/. The web root is public_html.
contentYesThe whole file content: plain text for utf8, base64 for binary files
encodingNoutf8 (default) for text, base64 for binary content

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=true; the description goes well beyond them by specifying that existing content is replaced entirely, that missing parent directories are auto-created, a 32 MB size cap, and that files under public_html go live on the website immediately. The immediate-publication consequence is exactly the kind of side effect an agent needs before writing blindly.

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?

Five short sentences, front-loaded with the primary action and immediately followed by the destructive-overwrite warning and the sibling routing. Each sentence carries distinct operational information with no repetition of the title or schema.

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?

For a destructive write tool with no output schema, the description covers side effects, the directory jail, size limit, and live-publication behavior — nearly everything needed to call it safely. The only gap is what the call returns (e.g., confirmation or resulting path), which is a minor omission given the coverage of risk-relevant 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 description coverage is 100%, so id, path, content, and encoding are already documented, including the utf8/base64 distinction and the public_html web root. The description reinforces the home-directory jail for path but adds no new syntax, format, or constraint details beyond the schema; baseline 3 applies.

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 ('Create or overwrite a file inside a webspace') plus scope ('as its site user, jailed to the home directory'), and explicitly names the sibling it is not ('For a VPS use vps_write_file'). An agent can distinguish this from vps_write_file and from webspace_read_file without opening any schema.

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?

Gives explicit routing: use vps_write_file for VPS targets, and use webspace_read_file first when only partially modifying an existing file. Both the when-to-use and the when-to-use-something-else conditions are spelled out rather than inferred.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.