Skip to main content
Glama

Write / Update a File on Litewrite

litewrite_write_file
DestructiveIdempotent

Replace the entire content of an existing file in a Litewrite project by providing the project ID, file path, and new text content. Use for updating files, not creating new ones.

Instructions

Replace the full content of an existing file on the Litewrite server (POST /api/internal/files/edit).

For creating a brand-new file use litewrite_create_file; for binary files use litewrite_upload_file.

Args:

  • projectId (string, required): The project id.

  • filePath (string, required): Path relative to the project root.

  • content (string, required): The new full text content.

Returns a confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe complete new file content
filePathYesPath relative to the project root
projectIdYesThe Litewrite project id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered. The description adds value by clarifying the 'full content' replacement semantics (no merge/append) and that the file must already exist, plus the endpoint. It stops short of explaining failure modes when the file is absent, so a 4 rather than 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then alternatives, then args, then return value – a sensible ordering. It is appropriately sized, though the Args list duplicates the 100%-covered schema, which is minor 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?

No output schema exists, and the description states 'Returns a confirmation,' which is thin but adequate for a write tool. Combined with annotations covering the safety profile and clear sibling routing, the definition is nearly complete; only error/failure behavior when the target file is missing is unaddressed.

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 the schema already documents all three parameters with descriptions and types. The Args block in the description merely restates the schema without adding format, path, or content semantics. Baseline 3 applies when the schema does the heavy lifting.

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 states a specific verb and resource ('Replace the full content of an existing file') and even names the endpoint. It distinguishes itself from siblings by specifying the 'existing file' constraint and routing new files to litewrite_create_file. An agent can identify exactly what this tool does and does not do.

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?

Explicit alternatives with conditions: use litewrite_create_file for brand-new files and litewrite_upload_file for binary files. This is genuine when-to-use/when-not guidance rather than implied context, leaving nothing to inference.

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