Skip to main content
Glama

sage_write_file

Create or update a file with append and overwrite. Returns confirmation without echoing content, saving tokens.

Instructions

Create or update a file. Returns bytes/lines/sha256 confirmation instead of echoing the content back — saves the whole file's tokens. Existing files require overwrite=true (a snapshot is taken first so it is reversible).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path to write
appendNoAppend instead of replace
contentYesFull file content
overwriteNoAllow replacing an existing file
Behavior5/5

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

Since no annotations are provided, the description fully discloses behavioral traits: it returns confirmation tokens instead of echoing content, saves tokens, requires overwrite for existing files, and takes a snapshot for reversibility. This is highly 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 long, each providing essential information without redundancy. It is front-loaded with the core purpose and follows with an important behavioral note.

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 or annotations, the description covers key aspects: purpose, return format, token saving, overwrite and reversibility. It does not mention error handling or directory creation, but is sufficiently complete for a file write tool.

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 baseline is 3. The description adds value by explaining the overwrite parameter's necessity for existing files, but does not elaborate on path, content, or append beyond the schema. This is slightly above baseline.

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 tool creates or updates a file, distinguishing itself from sibling read/edit tools. It specifies the return format (bytes/lines/sha256) and token-saving behavior, which are specific to this tool.

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 clear context: the tool can be used to create or update files, and it explicitly states that existing files require overwrite=true. However, it does not offer guidance on when to use this tool over alternatives like sage_edit_file or specific conditions to avoid.

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/PsYcGoD/sage'

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