Skip to main content
Glama

Write File

write_file

Create or replace .tsx, .ts, .css, or .json files in a Remotion project to build custom components, themes, and shared utilities that pre-built templates don't cover.

Instructions

Write a code file (.tsx, .ts, .css, .json) to the Remotion project. Use this to create custom components, theme files, shared utils, or any code the pre-built templates don't cover. Protected system files (Root.tsx, composition.json, package.json, etc.) cannot be overwritten. If the file already exists it will be replaced — a warning is included in the response. Call read_file first if you need to inspect existing content before editing.

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

Input Schema

NameRequiredDescriptionDefault
contentYesFull UTF-8 file content to write
filePathYesPath relative to project root where the file will be written. Allowed extensions: .tsx, .ts, .css, .json. Example: "src/overlays/BouncingBall.tsx"
projectPathYesAbsolute path to the Remotion project root

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/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 full burden and discloses allowed extensions, protected files that cannot be overwritten, replacement behavior for existing files, and a warning in the response. It does not cover error handling, parent-directory creation, or permissions, but the destructive overwrite risk is clearly surfaced.

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?

Front-loads purpose, then use cases, then constraints, then pre-call advice. Five short sentences, each earning its place with no redundant wording.

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 three-parameter file-write tool with no annotations and no output schema, the description covers core usage, protected-file constraints, overwrite behavior, and the read_file pre-check. It omits edge-case behavior such as invalid extension handling, directory creation, and exact success/error response format.

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 100%, so the schema already documents projectPath, filePath, and content. The description repeats the allowed extensions and reinforces overwrite behavior, but adds little parameter-level meaning beyond what the schema provides.

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 ('Write') and resource ('code file') with allowed extensions and target Remotion project. It distinguishes itself from pre-built templates by covering custom components, theme files, and shared utils, though it does not explicitly name which sibling to use for scenes/compositions.

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 concrete use cases (custom components, theme files, shared utils) and an exclusion (protected system files cannot be overwritten). It also advises calling read_file first for inspection, but does not explicitly route to add_overlay, create_scene, or update_composition for domain-specific edits.

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