Skip to main content
Glama

Write draft file

write_draft_file
Destructive

Create a new theme file in a Fudge draft, or with replace rewrite a whole file. New theme filenames include the draft’s file prefix, except templates, config and locales. Every sections/*.liquid file needs a {% schema %} with a non-empty "name".

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": {
      "draft": "<draft>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_draft_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesA theme file such as sections/main-product.liquid or templates/product.json, or a content document such as .entities/product/123.jsonc or .entities/page/45.body.html.
draftYesThe draft’s fudge://project/… ref.
storeNoThe connected store to use. Omit when only one is connected.
contentYesThe complete file content, without line gutters.
replaceNoTrue to replace an existing file you have read in full.
revisionNoThe revision returned when this file was read, when replacing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / content / description
      Previous value: -"The complete file content, without line numbers."New value: +"The complete file content, without line gutters."
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and non-idempotent, so safety is partly covered. The description adds real behavior beyond them: filenames inherit the draft's file prefix (except templates, config, locales), and sections/*.liquid content must contain a {% schema %} with a non-empty "name" — a concrete validation rule that will cause failures if ignored. It still does not say what replace does to unread content or how revision mismatches behave.

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?

Two tight sentences with the primary action front-loaded and the mode variant immediately after. The naming and schema-validation rules are compact and earn their place; no filler wording.

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

Completeness3/5

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

A six-parameter, destructive write tool with no output schema benefits from the stated validation and naming rules, but the description never addresses routing against edit_draft_file or what happens on a revision conflict — gaps an agent would need before calling confidently.

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 the schema already defines path, draft, content, replace, and revision. The description only reinforces `replace` as whole-file rewrite, adding little beyond the schema's own wording.

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 concrete verb and resource: create a new theme file in a Fudge draft, or rewrite a whole file when `replace` is set. It does not name the nearest sibling (edit_draft_file) or explain how this differs from it, so the agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The `replace` clause implies two modes (create vs. overwrite) and the revision parameter hints that overwriting follows a read. However, there is no explicit when-to-use guidance versus edit_draft_file or delete_draft_file, and no stated preconditions for choosing replace over an edit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.