Node tools of the Flows MCP server
The 14 tools that work on node types and on single nodes or lists of nodes. How to connect, and how deploys, checks and errors come back, is in Flows MCP server. To read or replace a whole tab, use the Flow tools.
The write tools of this page deploy to the running Node-RED at once, as a partial deploy in which only the affected nodes restart, and report the deploy check. Their JSON answers carry it in the deploy field.
Shared rules:
- Global config nodes. Config nodes that belong to no tab (an MQTT broker, a dashboard base, a TLS configuration shared by several tabs) are handled like the others:
get-node-config,update-node-config,batch-update-nodesanddelete-nodefind the node wherever it is and say where it lives:global, or its tab.create-nodeandbatch-create-nodescreate a global config node whenflowIdis left out; when the palette category of the type can be read, types outside theconfigcategory are refused, because they need a tab. - Id, type and tab do not change. The update tools refuse a different
id,typeorz. To move nodes to another tab, usemove-nodes; a global config node never gets a tab. - Credentials go in the node's
credentialsobject. Their values are stored outside the flows file and never returned: answers say only which credential fields were given. Changing them restarts the node and the nodes that depend on it. - Overlap warnings.
create-node,batch-create-nodes(withautoPosition),update-node-config(whenx,y,name,loroutputschange) andbatch-update-nodes(whenxorychange) may answer withoverlap_detectedwarnings. They use estimated node sizes;capture-flowmeasures the real ones.
Node types
get-nodes
The modules installed in Node-RED and the node types each one provides: id, module, types, version, enabled and local flags.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
module | string | no | Only this module, for example node-red |
get-node-schema
The schema of a node type, read from its editor definition: every property with its default value, the required ones, the editor's validations, references to config nodes (with their type), the options of selects, checkboxes and typed inputs, the credential fields (names and type, never values), category, color, inputs and outputs. Defaults that the editor computes at run time are listed as dynamicDefault with their source. Call it before creating nodes of a type.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeType | string | yes | For example inject, function |
includeExamples | boolean | no | Add a complete example node that create-node accepts as it is. Default false |
get-node-help
The help text of a node type, as the editor shows it in its help panel.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeType | string | yes | Node type, or module/set |
outputFormat | markdown or html | no | Default markdown |
Returns nodeType, module and helpMarkdown (or helpHtml).
Reading nodes
search-nodes
Finds deployed nodes across all tabs by type or by content, and returns their full configuration.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
type | string | no | Exact node type |
query | string | no | Text to find. Without property, it is searched in the whole node |
property | string | no | Search query only in this property, for example name or topic |
get-node-config
The configuration of one node: a flow node, a config node of a tab or a global config node (reported with flow: "global"). Not for tabs or subflow definitions.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string | yes | |
includeWires | boolean | no | Include the wires. Default false |
For types with credentials, credentials lists each credential field as set or missing, with its type, as the runtime has them; values are never returned. A credential field stored as a plain property in the flows file is shown hidden. credentialNotes explains the fields that the type declares twice, as a property and as a credential.
Creating
create-node
Creates one node and deploys it. The defaults of the node type are not filled in: pass every property the node needs (get-node-schema with includeExamples: true gives a template). Only eight core types (inject, debug, function, change, switch, http in, http request, http response) start from a built-in set of defaults, which the properties passed override.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
type | string | yes | Node type |
flowId | string | no | Tab to create it on. Leave it out to create a global config node |
properties | object | no | The node's properties. x and y default to 100 |
wires | array of arrays of node ids | no | One array per output. Default [[]] |
strict | boolean | no | Refuse the change, instead of only warning, when a property is not defined by the node type or a credential is passed as a plain property. Default false |
dryRun | boolean | no | Report what would change and deploy nothing |
Returns nodeId, type, flowId (or scope: "global"), the configuration written and the deploy check. The id is generated: an id in properties is ignored.
A link out node only delivers to the link in nodes in its own links list: to connect tabs, set links on both nodes, as the editor does when a link wire is drawn.
batch-create-nodes
Creates several nodes in one deploy, with automatic positions and, if asked, wires between them.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
flowId | string | no | Tab to create them on. Leave it out to create global config nodes; positions and wires then do not apply |
nodes | array of objects | yes | The nodes: see below |
autoPosition | boolean | no | Lay the nodes out in a row, spaced by their estimated widths. Default true. Set false when passing x and y |
autoWire | boolean | no | Wire each node to the next one, in order. Default false |
strict | boolean | no | As in create-node |
dryRun | boolean | no | Report what would change and deploy nothing |
Each element of nodes:
| Field | Type | Required | Meaning |
|---|---|---|---|
type | string | yes | Node type |
ref | string | no | A temporary name other nodes of the same call can use to point to this one |
id | string | no | A proposed id, which must not exist yet. It can be used as a reference too. Default: generated |
properties | object | no | The node's properties |
wires | array of arrays | no | Ids of existing nodes or refs of this call. Replaced by autoWire |
References inside the call (ref or a proposed id) can be used in wires, in g (a group created in the same call), in the nodes list of a group, in the links of link nodes, in the scope of catch and status nodes, and in config-node properties such as a broker. A group with its members, or nodes wired to each other, are created in one call. A group created without a size is fitted around its new members.
Returns created, nodeIds, nodes (id, type and position of each), refs (each ref with its id) and the deploy check.
Changing
update-node-config
Changes properties of one node and deploys it.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string | yes | |
properties | object | yes | The properties to change, for example {"name": "Parse data", "wires": [["a1b2"]]}. Each key replaces the stored value; the others are kept |
strict | boolean | no | As in create-node |
dryRun | boolean | no | Report what would change and deploy nothing |
Returns nodeId, scope, updatedProperties and the deploy check, plus flowId for a node of a tab or type for a global config node.
batch-update-nodes
Changes properties of several nodes, on any tabs and global config nodes alike, in one deploy. An unknown id cancels the whole call before anything is deployed.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
updates | array of { nodeId, properties } | yes | One element per node, with the properties to change |
strict | boolean | no | As in create-node |
dryRun | boolean | no | Report what would change and deploy nothing |
Returns updatedCount, flowCount, globalCount, nodes and the deploy check. Use it to move nodes on the canvas (x, y), or to rename many nodes at once.
move-nodes
Moves nodes or groups to another tab, keeping their ids, the wires between them, their groups (a group moves with all its members, nested groups included) and the references of link nodes. The moved nodes restart on the new tab.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
ids | array of strings | yes | Node or group ids, at least one |
targetTab | string | yes | Tab to move them to |
x | number | no | New left edge of the selection. Default: same positions |
y | number | no | New top edge of the selection |
convertCrossWires | boolean | no | Replace each wire between a moved and a non-moved node with a link out and link in pair. Default false: the move is refused and lists those wires |
dryRun | boolean | no | Report the plan and deploy nothing |
A moved node whose group stays behind leaves that group, and the scopes of catch, status and complete nodes are cleaned. Flow context belongs to a tab: moved nodes that use it are listed with their keys as a warning, because on the new tab they see the values of that tab.
Deleting
delete-node
Deletes one node and deploys; the node stops.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string | yes | |
cleanupWires | boolean | no | Also remove the references to it: wires from other nodes, links of link nodes and group membership. Default true |
force | boolean | no | Delete a config node that other nodes still use. Default false. Those nodes are left without configuration and fail at run time |
dryRun | boolean | no | Report what would change and deploy nothing |
Config nodes are bound by property, not by wires: deleting one that is still in use is refused, with the nodes that use it, unless force: true.
delete-nodes
Deletes a list of nodes in one deploy and removes every reference to them: wires from any node, the links of link nodes on both ends (also on other tabs), the member lists of groups and the scopes of catch, status and complete nodes. A group id deletes the group with all its members, as the editor does.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
ids | array of strings | yes | Node or group ids, at least one |
force | boolean | no | Delete config nodes even when nodes that stay still use them |
dryRun | boolean | no | List what would be deleted and cleaned, and deploy nothing |
The answer lists the deleted nodes per tab, the references removed, references left dangling, groups left empty and, with force, the nodes now left without their config node.
Running
restart-nodes
Restarts nodes without changing their configuration, like stopping and starting them: to recover a node stuck in a bad state, retry a connection, or make a node read something again at start. A config node restarts together with every node that uses it, and a group id restarts its members. Messages in flight in the restarted nodes are lost.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
ids | array of strings | yes | Node, config node or group ids, at least one |
dryRun | boolean | no | List the nodes that would restart and deploy nothing |
The restart is a partial deploy that leaves the configuration and the stored credentials as they are. Node-RED may log Credential type … is not registered for types without credentials; that line is expected. To restart a whole tab, use update-tab with disabled: true and then false, or reload-flows for everything.
inject
Triggers an inject node, exactly like its button in the editor, whatever its own schedule. The message goes into the running flow: everything the flow does with it happens.
| Parameter | Type | Required |
|---|---|---|
id | string | yes |
Returns only a confirmation with the node, its tab and the time. To see what happened, use the Debugging tools.