Skip to content

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-nodes and delete-node find the node wherever it is and say where it lives: global, or its tab. create-node and batch-create-nodes create a global config node when flowId is left out; when the palette category of the type can be read, types outside the config category are refused, because they need a tab.
  • Id, type and tab do not change. The update tools refuse a different id, type or z. To move nodes to another tab, use move-nodes; a global config node never gets a tab.
  • Credentials go in the node's credentials object. 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 (with autoPosition), update-node-config (when x, y, name, l or outputs change) and batch-update-nodes (when x or y change) may answer with overlap_detected warnings. They use estimated node sizes; capture-flow measures 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.

ParameterTypeRequiredMeaning
modulestringnoOnly 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.

ParameterTypeRequiredMeaning
nodeTypestringyesFor example inject, function
includeExamplesbooleannoAdd 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.

ParameterTypeRequiredMeaning
nodeTypestringyesNode type, or module/set
outputFormatmarkdown or htmlnoDefault 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.

ParameterTypeRequiredMeaning
typestringnoExact node type
querystringnoText to find. Without property, it is searched in the whole node
propertystringnoSearch 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.

ParameterTypeRequiredMeaning
nodeIdstringyes
includeWiresbooleannoInclude 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.

ParameterTypeRequiredMeaning
typestringyesNode type
flowIdstringnoTab to create it on. Leave it out to create a global config node
propertiesobjectnoThe node's properties. x and y default to 100
wiresarray of arrays of node idsnoOne array per output. Default [[]]
strictbooleannoRefuse 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
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
flowIdstringnoTab to create them on. Leave it out to create global config nodes; positions and wires then do not apply
nodesarray of objectsyesThe nodes: see below
autoPositionbooleannoLay the nodes out in a row, spaced by their estimated widths. Default true. Set false when passing x and y
autoWirebooleannoWire each node to the next one, in order. Default false
strictbooleannoAs in create-node
dryRunbooleannoReport what would change and deploy nothing

Each element of nodes:

FieldTypeRequiredMeaning
typestringyesNode type
refstringnoA temporary name other nodes of the same call can use to point to this one
idstringnoA proposed id, which must not exist yet. It can be used as a reference too. Default: generated
propertiesobjectnoThe node's properties
wiresarray of arraysnoIds 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.

ParameterTypeRequiredMeaning
nodeIdstringyes
propertiesobjectyesThe properties to change, for example {"name": "Parse data", "wires": [["a1b2"]]}. Each key replaces the stored value; the others are kept
strictbooleannoAs in create-node
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
updatesarray of { nodeId, properties }yesOne element per node, with the properties to change
strictbooleannoAs in create-node
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
idsarray of stringsyesNode or group ids, at least one
targetTabstringyesTab to move them to
xnumbernoNew left edge of the selection. Default: same positions
ynumbernoNew top edge of the selection
convertCrossWiresbooleannoReplace 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
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
nodeIdstringyes
cleanupWiresbooleannoAlso remove the references to it: wires from other nodes, links of link nodes and group membership. Default true
forcebooleannoDelete a config node that other nodes still use. Default false. Those nodes are left without configuration and fail at run time
dryRunbooleannoReport 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.

ParameterTypeRequiredMeaning
idsarray of stringsyesNode or group ids, at least one
forcebooleannoDelete config nodes even when nodes that stay still use them
dryRunbooleannoList 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.

ParameterTypeRequiredMeaning
idsarray of stringsyesNode, config node or group ids, at least one
dryRunbooleannoList 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.

ParameterTypeRequired
idstringyes

Returns only a confirmation with the node, its tab and the time. To see what happened, use the Debugging tools.