Skip to main content
Glama

validate_node_config

Validate node configuration parameters against type definitions to ensure proper setup and prevent errors in n8n workflows.

Instructions

Validate a node configuration against its type definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialsNoOptional credentials object
paramsYesThe node parameters to validate
typeYesThe node type name

Implementation Reference

  • src/index.ts:138-159 (registration)
    Tool registration in the MCP server's listTools response, including input schema definition.
    { name: 'validate_node_config', description: 'Validate a node configuration against its type definition', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'The node type name', }, params: { type: 'object', description: 'The node parameters to validate', }, credentials: { type: 'object', description: 'Optional credentials object', }, }, required: ['type', 'params'], }, },
  • Primary MCP server handler for 'validate_node_config' tool that delegates to N8nClient.
    private async handleValidateNodeConfig(args: { type: string; params: Record<string, any>; credentials?: Record<string, string> }) { const result = await this.n8nClient.validateNodeConfiguration( args.type, args.params, args.credentials ); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(result), null, 2) }] }; }
  • N8nClient method that performs node configuration validation by calling node-validator.
    async validateNodeConfiguration( nodeType: string, parameters: Record<string, any>, credentials?: Record<string, string> ): Promise<ValidationResult> { return validateFullNodeConfig(nodeType, parameters, credentials); }
  • Core validation function combining parameter and credential validation.
    export function validateFullNodeConfig( nodeType: string, parameters: Record<string, any>, credentials: Record<string, string> = {} ): ValidationResult { const parameterValidation = validateNodeConfig(nodeType, parameters); const credentialErrors = validateCredentials(nodeType, credentials); return { valid: parameterValidation.valid && credentialErrors.length === 0, errors: [...parameterValidation.errors, ...credentialErrors], }; }
  • Helper function that validates node parameters against the node type schema properties.
    export function validateNodeConfig(nodeType: string, parameters: Record<string, any>): ValidationResult { const errors: ValidationError[] = []; // Get the node type definition const nodeTypeDef = getNodeType(nodeType); if (!nodeTypeDef) { errors.push({ property: 'type', message: `Unknown node type: ${nodeType}`, code: 'INVALID_TYPE', expected: 'Known node type', actual: nodeType, }); return { valid: false, errors }; } // Validate each property in the node type definition for (const property of nodeTypeDef.properties) { const value = parameters[property.name]; const propertyErrors = validateProperty(property, value, parameters); errors.push(...propertyErrors); } return { valid: errors.length === 0, errors, }; }

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

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