Skip to main content
Glama

add_node_to_workflow

Append a node to an existing n8n workflow for testing and inspection purposes within a safe environment.

Instructions

Append a node JSON object to an existing workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowIdYes
nodeYes

Implementation Reference

  • The core implementation function that adds a node to a workflow by fetching the workflow, appending the node to the nodes array, and updating the workflow via n8n API.
    export async function addNodeToWorkflow(workflowId: string, node: Record<string, unknown>) {
      const workflow = await getWorkflow(workflowId);
      const nodes = Array.isArray(workflow.nodes) ? workflow.nodes : [];
      workflow.nodes = [...nodes, node];
      return await updateWorkflow(workflowId, workflow);
    }
  • src/index.ts:77-84 (registration)
    Tool registration defining the tool name, description, and input schema with workflowId (string) and node (object) as required parameters.
      name: 'add_node_to_workflow',
      description: 'Append a node JSON object to an existing workflow.',
      inputSchema: {
        type: 'object',
        properties: { workflowId: { type: 'string' }, node: { type: 'object' } },
        required: ['workflowId', 'node'],
      },
    },
  • Request handler that validates input arguments using Zod schema, calls the addNodeToWorkflow function, and returns the result as JSON text.
    if (name === 'add_node_to_workflow') {
      const { workflowId, node } = z.object({ workflowId: z.string(), node: z.record(z.unknown()) }).parse(args);
      const updated = await addNodeToWorkflow(workflowId, node);
      return { content: [{ type: 'text', text: JSON.stringify(updated, null, 2) }] };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'append a node JSON object', implying a write/mutation operation, but doesn't disclose critical traits: whether this requires specific permissions, if it's idempotent, what happens on failure, or the response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word contributes directly to understanding the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (mutation with nested objects), lack of annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't address behavioral aspects, parameter details, or output expectations, making it inadequate for safe and effective use by an AI agent without additional context.

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

Parameters2/5

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

The description mentions 'node JSON object' and 'existing workflow', which loosely maps to the 'node' and 'workflowId' parameters, but with 0% schema description coverage, it adds minimal value. It doesn't explain the structure of the 'node' object, expected properties, or format for 'workflowId', leaving parameters largely undocumented beyond their names.

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?

The description clearly states the action ('Append') and resource ('node JSON object to an existing workflow'), making the purpose understandable. It distinguishes from siblings like 'create_workflow' (creates new) and 'update_workflow' (modifies existing), though it doesn't explicitly mention these alternatives. The verb 'append' is specific but could be more detailed about what 'append' entails in this context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., workflow must exist), exclusions (e.g., not for modifying nodes), or compare to siblings like 'update_workflow' or 'connect_nodes'. Usage is implied by the action but lacks explicit context for selection.

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/Souzix76/n8n-workflow-tester-safe'

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