Skip to main content
Glama

write_node_file

Write a file into a custom-node pack under custom_nodes/, with options to overwrite existing files and create parent directories. Use for creating or replacing whole files in ComfyUI custom nodes.

Instructions

Create or overwrite one file inside a custom-node pack under custom_nodes/. Refuses to clobber an existing file unless overwrite is true, and creates parent directories by default. Use for whole-file edits or new files; for surgical edits prefer apply_node_patch. After writing, run verify_custom_node and restart_comfyui to load the change. LOCAL-ONLY (requires COMFYUI_PATH); the path is jailed to custom_nodes/.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPack-relative path under custom_nodes/, e.g. 'MyPack/nodes.py'.
contentYesFull file contents to write.
overwriteNoOverwrite an existing file instead of refusing (default false).
create_dirsNoCreate missing parent directories (default true).
Behavior5/5

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

With no annotations provided, the description fully carries the burden. It discloses key behaviors: 'Refuses to clobber an existing file unless overwrite is true', 'creates parent directories by default', and 'LOCAL-ONLY (requires COMFYUI_PATH); the path is jailed to custom_nodes/'. No contradictions.

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 sentences that front-load the purpose, then constraints, then usage hints. No wasted words; every sentence adds value.

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?

While the description covers core behavior, constraints, and post-actions, it lacks explicit mention of success/error responses or return values. However, since there is no output schema, the description is largely complete for a file write tool. Minor gap on response handling.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds meaning beyond the schemas: it explains the default behavior for overwrite (refuses unless true) and create_dirs (creates by default), and contextualizes the path as pack-relative under custom_nodes/.

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?

Clearly states 'Create or overwrite one file inside a custom-node pack under custom_nodes/'. It uses a specific verb (create/overwrite) and resource (file under custom_nodes/). The description also distinguishes from sibling tool apply_node_patch by advising its use for surgical edits.

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

Usage Guidelines5/5

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

Explicitly says when to use this tool ('Use for whole-file edits or new files') and when to use an alternative ('for surgical edits prefer apply_node_patch'). It also provides context on post-write steps (verify_custom_node, restart_comfyui) and notes it is LOCAL-ONLY with a jailed path.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/artokun/comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server