Skip to main content
Glama

write_file

Destructive

Create a new text file or replace an existing file’s full content and push it to Overleaf, with folders created as needed; use edit for existing files to avoid accidental text loss.

Instructions

Create a new text file, or replace a file's entire content, and push it to Overleaf.

Prefer edit_file for changes to existing files: it cannot accidentally drop text.

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": {
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile to create or overwrite, relative to the project root. Folders are created as needed.
contentYesThe complete new file content.
messageNoCommit message shown in Overleaf's history.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already flag destructiveHint=true and openWorldHint=true, so the safety profile is declared. The description goes beyond them by specifying what is destroyed (the file's entire content) and naming the concrete risk ('accidentally drop text'), which tells the agent why this call is dangerous rather than just that it is.

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?

Two sentences with zero waste: the primary action comes first, followed immediately by the sibling routing rule and its rationale. Nothing is repeated from the schema or annotations.

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 three-parameter mutation tool with full schema coverage and no output schema, the description covers the action, the scope of the overwrite, the remote destination, and the safer alternative. The only minor gap is that it does not say whether overwriting a nonexistent file or pushing over unpushed changes has special consequences.

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 coverage is 100%, and the schema already explains that path is relative to the project root with folders created as needed, that content is the complete file content, and that message is the commit message. The description adds no parameter-level detail beyond what the schema provides, so the baseline of 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?

The description gives a specific verb and resource ('Create a new text file, or replace a file's entire content') and adds the destination ('push it to Overleaf'). It also explicitly distinguishes itself from the sibling edit_file, so an agent can choose between them without opening either schema.

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?

It states a clear selection rule: prefer edit_file for changes to existing files, with the reason ('it cannot accidentally drop text'). It does not cover other plausible alternatives such as upload_file or delete_file, but the guidance it gives is concrete and actionable.

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