Skip to main content
Glama

insert_macro

Insert a macro sub-workflow into a dynamic ComfyUI workflow, connect its input ports to existing nodes, and return nodeIdMap and outputPorts so you can wire macro outputs.

Instructions

Insert a macro (sub-workflow) into a dynamic workflow. Connects macro input ports to existing nodes. Returns nodeIdMap and outputPorts so you can connect macro outputs. Use workflow_id from create_workflow.

Input Schema

NameRequiredDescriptionDefault
macro_idYesMacro id (e.g. upscale_refine). Use list_macros to see available.
workflow_idYesWorkflow id from create_workflow
input_connectionsYesMap port name -> [source node id, output index] for links, or literal (e.g. filename for LoadImage)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully discloses return values ('Returns nodeIdMap and outputPorts') despite there being no output schema, and it describes the mutation (connecting input ports to existing nodes). It does not cover failure modes, whether the workflow must already exist, or what happens to the connections if insertion fails — a notable gap for a mutating tool with a nested connections object.

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?

Four short sentences, front-loaded with the action and resource before the return-value and prerequisite details. Every sentence carries distinct information — no restatement of the tool name and no filler.

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 3-param mutation tool with a nested object, no annotations, and no output schema, the description does the important work: it explains the operation, the port-connection input, and the returned nodeIdMap/outputPorts needed for downstream connection. It stops short of covering error or existence behavior, keeping it just below complete.

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 all three parameters are already documented in the schema, establishing the baseline of 3. The description reinforces the meaning of input_connections ('Connects macro input ports to existing nodes') and the role of workflow_id, but adds no format or syntax detail beyond the schema's own 'Map port name -> [source node id, output index]' explanation.

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 specific verb and resource: 'Insert a macro (sub-workflow) into a dynamic workflow.' The parenthetical clarifies the domain abstraction, distinguishing it from add_node's single-node operation, and it names the connection semantics. It doesn't explicitly point at add_node or list_macros as siblings, so a 4 rather than a 5.

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?

It gives the ordering prerequisite 'Use workflow_id from create_workflow' and notes the return values are needed to connect macro outputs, which implies the sequencing relative to connect_nodes. However, it never says when to prefer this over add_node, or that list_macros should be consulted first (that hint only lives in the schema param). Usage is implied, not stated.

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