Skip to main content
Glama

write_file

Replace a file's full content in a CSTCloud LaTeX project. Read the file first, then write back to avoid edit conflicts.

Instructions

Write (replace) the content of a document in a CSTCloud LaTeX project. This replaces the entire file content with the provided text. WARNING: If another user is editing the same file simultaneously, changes may conflict. Use read_file first to get the current content, then modify and write back.

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

Input Schema

NameRequiredDescriptionDefault
contentYesThe new full content of the file
file_idYesThe file/document ID (from get_project_files)
project_idYesThe project ID

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?

With no annotations provided, the description carries the burden and does well: it discloses that the entire content is destroyed and replaced, and warns about concurrent-editing conflicts. It omits auth/permission requirements and whether a missing file is created or errors, which keeps it from a 5.

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 tight sentences, front-loaded with the action and its replace semantics, followed by the conflict warning and the recommended workflow. No filler or redundancy.

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 3-parameter mutation tool with no annotations and no output schema, the description covers destructive semantics, concurrency risk, and correct call sequencing. Only the return behavior and permission prerequisites are left unaddressed.

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 100%, so project_id, file_id, and content are already documented in the schema. The description reinforces that 'content' is the full replacement text but adds no format, size, or cross-parameter constraints beyond that, matching the baseline of 3.

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 (write/replace) and resource (a document's content in a CSTCloud LaTeX project), and explicitly clarifies the replace-all semantics so an agent can distinguish it from an append or patch operation. The mention of read_file further separates it from the read sibling.

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?

Gives an explicit prerequisite workflow: read_file first, modify, then write back. It does not state when-not-to-use or name a batch/multi-file alternative, so it falls short of a full when/when-not/alternatives treatment.

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