Skip to main content
Glama

validate_node

Read-onlyIdempotent

Validate n8n node configurations to ensure proper setup before workflow execution. Choose full validation for detailed feedback or minimal mode for quick checks.

Instructions

Validate n8n node configuration. Use mode='full' for comprehensive validation with errors/warnings/suggestions, mode='minimal' for quick required fields check. Example: nodeType="nodes-base.slack", config={resource:"channel",operation:"create"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeTypeYesNode type as string. Example: "nodes-base.slack"
configYesConfiguration as object. For simple nodes use {}. For complex nodes include fields like {resource:"channel",operation:"create"}
modeNoValidation mode. full=comprehensive validation with errors/warnings/suggestions, minimal=quick required fields check only. Default is "full"full
profileNoProfile for mode=full: "minimal", "runtime", "ai-friendly", or "strict". Default is "ai-friendly"ai-friendly

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
errorsNo
summaryNo
nodeTypeYes
warningsNo
displayNameYes
suggestionsNo
workflowNodeTypeNo
missingRequiredFieldsNoOnly present in mode=minimal

Implementation Reference

  • Primary handler function for the 'full' validation mode of validate_node tool. Fetches node definition, handles missing nodes, extracts user-provided config keys to avoid false warnings, and delegates to ConfigValidator for detailed validation including errors, warnings, and suggestions.
    async validateNodeOperation(args: any) {
      // Get node properties and validate
      const node = await this.repository.getNodeByType(args.nodeType);
      if (!node) {
        return {
          valid: false,
          errors: [{ type: 'invalid_configuration', property: '', message: 'Node type not found' }],
          warnings: [],
          suggestions: [],
          visibleProperties: [],
          hiddenProperties: []
        };
      }
    
      // CRITICAL FIX: Extract user-provided keys before validation
      // This prevents false warnings about default values
      const userProvidedKeys = new Set(Object.keys(args.config || {}));
    
      return ConfigValidator.validate(args.nodeType, args.config, node.properties || [], userProvidedKeys);
    }
  • Handler function for the 'minimal' validation mode of validate_node tool. Quickly checks only for missing required fields using PropertyFilter.getEssentials.
    async validateNodeMinimal(args: any) {
      // Get node and check minimal requirements
      const node = await this.repository.getNodeByType(args.nodeType);
      if (!node) {
        return { missingFields: [], error: 'Node type not found' };
      }
      
      const missingFields: string[] = [];
      const requiredFields = PropertyFilter.getEssentials(node.properties || [], args.nodeType).required;
      
      for (const field of requiredFields) {
        if (!args.config[field.name]) {
          missingFields.push(field.name);
        }
      }
      
      return { missingFields };
    }
  • Tool schema definition and registration in the main tools array exported for MCP server registration. Includes inputSchema with parameters (nodeType required string, config required object, mode enum full/minimal, profile enum), outputSchema with validation results structure, and description.
    {
      name: 'validate_node',
      description: `Validate n8n node configuration. Use mode='full' for comprehensive validation with errors/warnings/suggestions, mode='minimal' for quick required fields check. Example: nodeType="nodes-base.slack", config={resource:"channel",operation:"create"}`,
      inputSchema: {
        type: 'object',
        properties: {
          nodeType: {
            type: 'string',
            description: 'Node type as string. Example: "nodes-base.slack"',
          },
          config: {
            type: 'object',
            description: 'Configuration as object. For simple nodes use {}. For complex nodes include fields like {resource:"channel",operation:"create"}',
          },
          mode: {
            type: 'string',
            enum: ['full', 'minimal'],
            description: 'Validation mode. full=comprehensive validation with errors/warnings/suggestions, minimal=quick required fields check only. Default is "full"',
            default: 'full',
          },
          profile: {
            type: 'string',
            enum: ['strict', 'runtime', 'ai-friendly', 'minimal'],
            description: 'Profile for mode=full: "minimal", "runtime", "ai-friendly", or "strict". Default is "ai-friendly"',
            default: 'ai-friendly',
          },
        },
        required: ['nodeType', 'config'],
        additionalProperties: false,
      },
      outputSchema: {
        type: 'object',
        properties: {
          nodeType: { type: 'string' },
          workflowNodeType: { type: 'string' },
          displayName: { type: 'string' },
          valid: { type: 'boolean' },
          errors: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                type: { type: 'string' },
                property: { type: 'string' },
                message: { type: 'string' },
                fix: { type: 'string' }
              }
            }
          },
          warnings: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                type: { type: 'string' },
                property: { type: 'string' },
                message: { type: 'string' },
                suggestion: { type: 'string' }
              }
            }
          },
          suggestions: { type: 'array', items: { type: 'string' } },
          missingRequiredFields: {
            type: 'array',
            items: { type: 'string' },
            description: 'Only present in mode=minimal'
          },
          summary: {
            type: 'object',
            properties: {
              hasErrors: { type: 'boolean' },
              errorCount: { type: 'number' },
              warningCount: { type: 'number' },
              suggestionCount: { type: 'number' }
            }
          }
        },
        required: ['nodeType', 'displayName', 'valid']
      },
    },
  • Detailed tool documentation including full description, parameters, returns, examples, use cases, performance notes, best practices, pitfalls, and related tools.
    import { ToolDocumentation } from '../types';
    
    export const validateNodeDoc: ToolDocumentation = {
      name: 'validate_node',
      category: 'validation',
      essentials: {
        description: 'Validate n8n node configuration. Use mode="full" for comprehensive validation with errors/warnings/suggestions, mode="minimal" for quick required fields check.',
        keyParameters: ['nodeType', 'config', 'mode', 'profile'],
        example: 'validate_node({nodeType: "nodes-base.slack", config: {resource: "channel", operation: "create"}})',
        performance: 'Fast (<100ms)',
        tips: [
          'Always call get_node({detail:"standard"}) first to see required fields',
          'Use mode="minimal" for quick checks during development',
          'Use mode="full" with profile="strict" before production deployment',
          'Includes automatic structure validation for filter, resourceMapper, etc.'
        ]
      },
      full: {
        description: `**Validation Modes:**
    - full (default): Comprehensive validation with errors, warnings, suggestions, and automatic structure validation
    - minimal: Quick check for required fields only - fast but less thorough
    
    **Validation Profiles (for mode="full"):**
    - minimal: Very lenient, basic checks only
    - runtime: Standard validation (default)
    - ai-friendly: Balanced for AI agent workflows
    - strict: Most thorough, recommended for production
    
    **Automatic Structure Validation:**
    Validates complex n8n types automatically:
    - filter (FilterValue): 40+ operations (equals, contains, regex, etc.)
    - resourceMapper (ResourceMapperValue): Data mapping configuration
    - assignmentCollection (AssignmentCollectionValue): Variable assignments
    - resourceLocator (INodeParameterResourceLocator): Resource selection modes`,
        parameters: {
          nodeType: { type: 'string', required: true, description: 'Node type with prefix: "nodes-base.slack"' },
          config: { type: 'object', required: true, description: 'Configuration object to validate. Use {} for empty config' },
          mode: { type: 'string', required: false, description: 'Validation mode: "full" (default) or "minimal"' },
          profile: { type: 'string', required: false, description: 'Validation profile for mode=full: "minimal", "runtime" (default), "ai-friendly", "strict"' }
        },
        returns: `Object containing:
    - nodeType: The validated node type
    - workflowNodeType: Type to use in workflow JSON
    - displayName: Human-readable node name
    - valid: Boolean indicating if configuration is valid
    - errors: Array of error objects with type, property, message, fix
    - warnings: Array of warning objects with suggestions
    - suggestions: Array of improvement suggestions
    - missingRequiredFields: (mode=minimal only) Array of missing required field names
    - summary: Object with hasErrors, errorCount, warningCount, suggestionCount`,
        examples: [
          '// Full validation with default profile\nvalidate_node({nodeType: "nodes-base.slack", config: {resource: "channel", operation: "create"}})',
          '// Quick required fields check\nvalidate_node({nodeType: "nodes-base.webhook", config: {}, mode: "minimal"})',
          '// Strict validation for production\nvalidate_node({nodeType: "nodes-base.httpRequest", config: {...}, mode: "full", profile: "strict"})',
          '// Validate IF node with filter\nvalidate_node({nodeType: "nodes-base.if", config: {conditions: {combinator: "and", conditions: [...]}}})'
        ],
        useCases: [
          'Validate node configuration before adding to workflow',
          'Quick check for required fields during development',
          'Pre-production validation with strict profile',
          'Validate complex structures (filters, resource mappers)',
          'Get suggestions for improving node configuration'
        ],
        performance: 'Fast validation: <50ms for minimal mode, <100ms for full mode. Structure validation adds minimal overhead.',
        bestPractices: [
          'Always call get_node() first to understand required fields',
          'Use mode="minimal" for rapid iteration during development',
          'Use profile="strict" before deploying to production',
          'Pay attention to warnings - they often prevent runtime issues',
          'Validate after any configuration changes'
        ],
        pitfalls: [
          'Empty config {} is valid for some nodes (e.g., manual trigger)',
          'mode="minimal" only checks required fields, not value validity',
          'Some warnings may be acceptable for specific use cases',
          'Credential validation requires runtime context'
        ],
        relatedTools: ['get_node', 'validate_workflow', 'n8n_autofix_workflow']
      }
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, indicating safe, repeatable operations. The description adds valuable context about validation scope (errors/warnings/suggestions vs required fields only) and provides concrete examples of node configurations, which enhances understanding beyond the basic safety profile.

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 efficiently structured in two sentences: the first states the purpose and mode differences, the second provides a concrete example. Every element serves a clear purpose with zero wasted words, making it easy to parse quickly.

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

Completeness5/5

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

Given the comprehensive input schema (100% coverage, enums, defaults), detailed annotations, and presence of an output schema, the description provides exactly what's needed: purpose clarification, mode guidance, and concrete examples. No additional explanation of return values is needed since output schema exists.

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?

With 100% schema description coverage, the schema already thoroughly documents all parameters. The description adds minimal value by briefly mentioning mode differences and providing a configuration example, but doesn't significantly enhance parameter understanding beyond what's already in the structured schema.

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?

The description clearly states the specific action ('validate n8n node configuration') and resource ('node'), distinguishing it from sibling tools like 'validate_workflow' which validates workflows instead of individual nodes. It provides concrete examples that reinforce the purpose.

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?

The description explicitly explains when to use different modes ('full' for comprehensive validation vs 'minimal' for quick checks), providing clear context for parameter selection. However, it doesn't specify when to use this tool versus alternatives like 'n8n_test_workflow' or 'validate_workflow' for broader testing scenarios.

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/czlonkowski/n8n-mcp'

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