Skip to main content
Glama

apply_node_patch

Apply a unified diff to custom node source files with two-phase validation, enabling precise edits to node packs found via search.

Instructions

Apply a unified diff to custom-node source under custom_nodes/. Every touched path is jail-checked BEFORE any git call, then the patch is validated with git apply --check and only applied if the check passes (two-phase; never uses --unsafe-paths). Paths are relative to custom_nodes/ and may carry a/ b/ prefixes; works on non-repo packs too. Ideal for surgical edits located via search_node_packs. LOCAL-ONLY (requires COMFYUI_PATH).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchYesA unified diff. File headers (---/+++) are read to determine touched paths, which must resolve inside custom_nodes/ (e.g. 'a/MyPack/nodes.py').
Behavior5/5

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

No annotations provided, so description carries full burden. Discloses critical safety checks: jail-check before git, two-phase validation with `git apply --check`, never uses --unsafe-paths. Also explains path handling and non-repo pack compatibility. Fully transparent.

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?

Five well-structured sentences, front-loaded with core action. Every sentence adds unique and necessary information without repetition or fluff. Concise yet comprehensive.

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 complex tool with no output schema, description covers purpose, safety, path rules, and environment requirement. Missing return value or success/failure indication, but behavior is well-explained. Mostly complete.

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 100% with one parameter 'patch'. Description adds value beyond schema by explaining that file headers (---/+++) are read to determine touched paths and that paths must resolve inside custom_nodes/. Provides additional context for usage.

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 it applies a unified diff to custom-node source under custom_nodes/, with specific verb 'apply' and resource 'node patch'. Differentiates from siblings by mentioning 'surgical edits located via search_node_packs', indicating a precise use case.

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?

Provides clear usage context: 'Ideal for surgical edits located via search_node_packs' and explicitly notes 'LOCAL-ONLY (requires COMFYUI_PATH)'. Does not specify when not to use or list alternative tools, but context is sufficiently clear.

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