Skip to content

Function: enrichValidationError()

ts
function enrichValidationError(
   originalError, 
   toolName, 
   actionKey, 
   config): SelfHealingResult;

Defined in: packages/core/src/introspection/ContractAwareSelfHealing.ts:92

Enrich a validation error with contract change context.

If the tool has relevant contract changes (from SelfHealingConfig.activeDeltas), this function injects them into the error XML so the LLM can self-correct.

Parameters

ParameterTypeDescription
originalErrorstringThe original XML error from formatValidationError()
toolNamestringThe tool that failed validation
actionKeystringThe action that failed
configSelfHealingConfigSelf-healing configuration with active deltas

Returns

SelfHealingResult

Enriched error string with contract context