Skip to main content
Glama

create_file

Creates a text document in an Overleaf project, optionally writing non-empty initial content as tracked changes for controlled edits.

Instructions

Create a text document and optionally record non-empty initial content as tracked changes. The content is written as by write_file once the empty document exists, so on a ShareJS (legacy editor) document, content that adds an emoji or other character outside the Basic Multilingual Plane is refused with INVALID_ARGUMENT; a timeout, a lost socket, or an Overleaf error after sending is observed, never resent; content the account may not write, such as untracked content from a review-only collaborator, is PERMISSION_DENIED before it is sent; and tracked content Overleaf applied without recording it as tracked changes by this account is PROTOCOL_UNSUPPORTED with details.kind applied_untracked, live and not reverted. If reading back or writing the content fails after the document was created, the error keeps its code and adds details.created: true; the document then exists, possibly empty, so do not create it again: read it with read_file and write the content with write_file.

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": {
      "projectId": "<projectId>",
      "filePath": "<filePath>"
    },
    "name": "create_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentNo
filePathYesProject-relative path using forward slashes
projectIdYesOverleaf project ID
writeModeNoUse tracked to record inserted and deleted text as Overleaf tracked changes; defaults to untrackeduntracked

Output Schema

NameRequiredDescriptionDefault
protocolYes
revisionYes
writeModeYes
trackChangesActiveYes
recoveredAfterTimeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say idempotentHint=false and destructiveHint=false; the description goes far beyond that with concrete failure modes: BMP-only limitation on ShareJS documents (INVALID_ARGUMENT), no automatic resend after timeout or lost socket, permission failures surfaced before send (PERMISSION_DENIED), and PROTOCOL_UNSUPPORTED with details.kind applied_untracked left live. It also discloses the partial-success state via details.created:true and the fact that the document may exist but be empty, which is exactly the behavioral context annotations cannot carry.

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?

The purpose is front-loaded in the first sentence, and the remaining content is dense but non-redundant error taxonomy that materially affects retry decisions. The long semicolon chain in the middle sentence (and the slightly garbled 'written as by write_file') costs readability, but little could be cut without losing a distinct failure mode.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a non-idempotent creation tool with an output schema and annotations, the description covers the operation, the side effects, the per-error outcomes, and the exact recovery path. An agent has everything needed to call it once and handle failure correctly without guessing.

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

Parameters4/5

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

Schema coverage is 75%, so the schema already documents filePath, projectId and writeMode. The description still adds real meaning beyond it: content is optional, only non-empty content is meaningful, and content interacts with the tracked/untracked writeMode distinction. It does not restate the path or project ID formats, but those are covered upstream.

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 first sentence gives a specific verb+resource ('Create a text document') plus the optional scope ('record non-empty initial content as tracked changes'). It also distinguishes itself from siblings by explaining that content is written as if by write_file once the empty document exists, so an agent can separate it from write_file and read_file without opening another 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 gives explicit 'when not to use / what to do instead' guidance: if creation fails after the document exists, do not create it again — use read_file then write_file. That is strong recovery routing. What it lacks is a general statement of when to pick create_file over upload_file or import_project_zip, so it falls short of full alternative enumeration.

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