Skip to main content
Glama

write_file

Create or overwrite a file (up to 3 MiB). Send text as-is, or bytes as base64 with encoding='base64'. Counts against the workspace owner's storage cap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesWhere to save the file, like 'drafts/report.md'. An existing file is overwritten (its history is kept).
contentYesThe file's content: text as-is, or bytes as base64 (then set encoding='base64').
encodingNo'text' (default) or 'base64' for binary content.text
api_tokenNoYour hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set.
content_typeNoThe file's media type, e.g. 'text/markdown' or 'image/png'. Optional.
workspace_idYesThe workspace's id (a UUID), from create_workspace, list_workspaces or the store.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / api_token / description
      Added value: +"Your hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set."
    • addedInput schema / properties / content / description
      Added value: +"The file's content: text as-is, or bytes as base64 (then set encoding='base64')."
    • addedInput schema / properties / content_type / description
      Added value: +"The file's media type, e.g. 'text/markdown' or 'image/png'. Optional."
    • addedInput schema / properties / encoding / description
      Added value: +"'text' (default) or 'base64' for binary content."
    • addedInput schema / properties / path / description
      Added value: +"Where to save the file, like 'drafts/report.md'. An existing file is overwritten (its history is kept)."
    • addedInput schema / properties / workspace_id / description
      Added value: +"The workspace's id (a UUID), from create_workspace, list_workspaces or the store."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, and the description sensibly adds the 3 MiB size ceiling, the base64 encoding rule, and the storage-cap side effect. The overwrite-with-history-kept behavior is disclosed in the schema, consistent with destructiveHint=false. It stops short of naming auth/permission requirements, keeping it at 4.

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, front-loaded with the core action and then the operational constraints. No filler or redundancy.

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?

With no output schema, the description should ideally tell the agent what a successful write returns, and it does not. Everything else an agent needs — size limit, encoding, storage accounting — is present, so the gap is minor.

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 coverage is 100%, so the baseline is 3. The description adds a real constraint on the content parameter (max 3 MiB) and reinforces the content/encoding coupling, going slightly beyond what the schema spells out.

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+resource ('Create or overwrite a file') and adds a scope constraint (up to 3 MiB). It cleanly distinguishes itself from sibling read/write ops like read_file, delete_file, and file_history.

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

Usage Guidelines3/5

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

Usage is implied by 'create or overwrite' — the agent can infer this is the write path with no append/edit alternative among the siblings. However, it never states when not to use it, nor how it relates to restore_file or file_history, so guidance is only implied.

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.

Resources