Skip to main content
Glama

Create or overwrite a file

write_file
Destructive

Create or update an Overleaf LaTeX file by writing full content, adding missing folders and applying a minimal live diff to preserve collaborator cursors.

Instructions

Writes the full content of a text file, creating it (and missing folders) if needed. Existing docs are updated in place via a minimal live diff, so collaborators keep their cursors. Prefer edit_file for small changes.

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
projectNoProject name, id or Overleaf URL. May be omitted when exactly one project is pinned.
suggestNoRecord changes to an existing doc as tracked changes
overwriteNoSet false to refuse replacing an existing file (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, so the safety profile is partly covered. The description adds genuine behavioral context beyond that: missing folders are auto-created, overwrites use a 'minimal live diff' preserving collaborator cursors, and the schema documents overwrite defaulting to true. It doesn't state permission/auth requirements or what happens if a co-editor changes the file during the write.

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, front-loaded with the operation and scope, then the routing hint. Every clause carries information the agent needs; no restatement of the title or boilerplate.

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 mutation with no output schema, the description covers creation, overwrite behavior, and the edit_file routing decision, and annotations carry the safety hints. Remaining gaps are secondary: no return value discussion, no conflict/error behavior, no project-disambiguation guidance for the optional project param.

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 60% (project, suggest, overwrite documented; path and content bare), so the baseline is a middling 3. The description implies 'full content' semantics for the content parameter and relates path to folder creation, but adds no format, encoding, path-resolution, or tracked-change detail beyond what the schema already states.

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 and resource ('Writes the full content of a text file') plus the creation scope ('creating it (and missing folders) if needed'). It names the sibling edit_file explicitly, so an agent can separate this from the small-edit tool 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?

'Prefer edit_file for small changes' gives an explicit alternative with the condition that selects it, which is the key routing decision among the file tools. However it doesn't cover the other nearby alternatives such as upload_file, create_folder, or delete_file, so the coverage is clear but not exhaustive.

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