Skip to main content
Glama

write_file

Write or overwrite a file in an Overleaf project with live updates and cursor preservation. Replaces the entire file, so read first if content may have changed.

Instructions

Create or overwrite a file. Writes are merged into the live document as an operational transform, so a human with the project open sees the change immediately and their cursor is preserved. NOTE: this replaces the whole file — read_file first if the content may have changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYese.g. main.tex, sections/intro.tex, refs.bib
contentYes
projectIdYes
Behavior4/5

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

With no annotations, the description must disclose behavioral traits on its own. It reveals operational transform merging, live document updates, cursor preservation, and whole-file replacement—all valuable context beyond mere 'write.' It does not mention permissions or failure modes, but the disclosed details are significant.

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 plus a prominent NOTE, with a clear front-loaded purpose. It wastes no words and structures the key safety warning at the end, making it easy to parse.

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 the tool's complexity (operational transform, live updates, overwrite risk), the description covers the critical behaviors and safety guidance. It does not describe return values, but no output schema exists, and this is not essential for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33% (only 'path' has a description). The description adds no explicit meaning for 'content' or 'projectId,' though the note about replacing the whole file implies 'content' is the full file contents. This is insufficient compensation for the low schema coverage.

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 begins with 'Create or overwrite a file,' which clearly states the verb and resource. This distinguishes it from sibling tools like read_file and delete_file by focusing on the write operation.

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 explicitly advises to 'read_file first if the content may have changed,' providing a direct alternative and a safety caveat. It implies this is the tool for creating or modifying file contents, but does not fully enumerate when not to use it.

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/lintheyoung/overleaf-mcp'

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