Skip to main content
Glama

validate_node_operation

Validate n8n node configurations by providing node type and configuration object. Ensure proper setup for workflow automation with profiles like strict, runtime, or ai-friendly.

Instructions

Validate n8n node configuration. Pass nodeType as string and config as object. Example: nodeType="nodes-base.slack", config={resource:"channel",operation:"create"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configYesConfiguration as object. For simple nodes use {}. For complex nodes include fields like {resource:"channel",operation:"create"}
nodeTypeYesNode type as string. Example: "nodes-base.slack"
profileNoProfile string: "minimal", "runtime", "ai-friendly", or "strict". Default is "ai-friendly"ai-friendly

Implementation Reference

  • Main execution handler for the validate_node_operation MCP tool. Retrieves node schema from repository and calls ConfigValidator for detailed validation.
    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); }
  • Input schema validation specifically for validate_node_operation tool parameters (nodeType: string required, config: object required, profile: optional enum).
    * Validate parameters for validate_node_operation tool */ static validateNodeOperation(args: any): ValidationResult { const nodeTypeResult = Validator.validateString(args.nodeType, 'nodeType'); const configResult = Validator.validateObject(args.config, 'config'); const profileResult = Validator.validateEnum( args.profile, 'profile', ['minimal', 'runtime', 'ai-friendly', 'strict'], false // optional ); return Validator.combineResults(nodeTypeResult, configResult, profileResult); }
  • Core helper function performing the detailed node configuration validation, including required fields, types, visibility, node-specific rules, security checks, and suggestions. Called by the handler.
    static validate( nodeType: string, config: Record<string, any>, properties: any[], userProvidedKeys?: Set<string> // NEW: Track user-provided properties to avoid warning about defaults ): ValidationResult { // Input validation if (!config || typeof config !== 'object') { throw new TypeError('Config must be a non-null object'); } if (!properties || !Array.isArray(properties)) { throw new TypeError('Properties must be a non-null array'); } const errors: ValidationError[] = []; const warnings: ValidationWarning[] = []; const suggestions: string[] = []; const visibleProperties: string[] = []; const hiddenProperties: string[] = []; const autofix: Record<string, any> = {}; // Check required properties this.checkRequiredProperties(properties, config, errors); // Check property visibility const { visible, hidden } = this.getPropertyVisibility(properties, config); visibleProperties.push(...visible); hiddenProperties.push(...hidden); // Validate property types and values this.validatePropertyTypes(properties, config, errors); // Node-specific validations this.performNodeSpecificValidation(nodeType, config, errors, warnings, suggestions, autofix); // Check for common issues this.checkCommonIssues(nodeType, config, properties, warnings, suggestions, userProvidedKeys); // Security checks this.performSecurityChecks(nodeType, config, warnings); return { valid: errors.length === 0, errors, warnings, suggestions, visibleProperties, hiddenProperties, autofix: Object.keys(autofix).length > 0 ? autofix : undefined }; }

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