Skip to main content
Glama

Write a file

write_file

Create or overwrite a file in an Overleaf project and save the full content to the project; use edit_file for partial changes.

Instructions

Create or overwrite a file in the Overleaf project and save it to Overleaf. Prefer edit_file for changing part of an existing file. Uses Git; falls back to the opt-in web mode if enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath relative to the project root.
contentYesFull new file content.
projectNoProject ID or Overleaf project URL (or project name in web mode). Defaults to OVERLEAF_PROJECT_ID.
commit_messageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose key traits: overwrite is destructive to existing content, the operation is persisted via Git, and there is an opt-in web-mode fallback. It omits permission/auth requirements and whether a commit is always created, so it is informative but not complete.

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?

Three short sentences, front-loaded with the destructive create/overwrite semantics, then the alternative, then the transport detail. Nothing is padding except a mild redundancy in "and save it to Overleaf".

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 mutation tool with no annotations and no output schema, the description covers the destructive nature, persistence mechanism, fallback path, and the preferred sibling for partial edits. Return value and commit behavior remain unstated, which is a modest gap rather than a blocking one.

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 75% and the description adds nothing about path, content, or project; its only parameter-adjacent contribution is confirming that web mode exists, which clarifies the schema's "project name in web mode" note. commit_message is undocumented in both schema and description, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb pair and resource ("Create or overwrite a file") plus the target system ("Overleaf project"), so the agent knows exactly what it does. It differentiates itself from edit_file, but does not distinguish itself from the sibling write_markdown, which is also a file-writing 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?

"Prefer edit_file for changing part of an existing file" gives an explicit alternative and the condition that selects it, which is exactly the routing an agent needs. No guidance is offered against write_markdown or when a full overwrite is inappropriate, so it stops short of full when/when-not coverage.

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