validate_form
Validate VA forms for schema compliance, syntax errors, and apostrophe usage to ensure adherence to VA.gov content standards and best practices.
Instructions
Run validation checks on a form (schema, syntax, apostrophes)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form_path | Yes | Path to form directory | |
| check_types | Yes | Types of checks to run |
Implementation Reference
- index.js:358-391 (handler)The handler for the 'validate_form' tool, which runs various validation checks (schema, apostrophes, imports, syntax) based on user input.
case 'validate_form': { const { form_path, check_types } = args; const checks = check_types.includes('all') ? ['schema', 'syntax', 'apostrophes', 'imports'] : check_types; const results = []; for (const checkType of checks) { switch (checkType) { case 'schema': results.push('## Schema Validation\n\nCommand to find uncalled radioSchema:\n```bash\ngrep -rn ": radioSchema[,\\s]" ' + form_path + '/pages/\n```'); break; case 'apostrophes': results.push('## Apostrophe Syntax Check\n\nCommand to find strings with apostrophes:\n```bash\ngrep -rn "\'\\w.*\'\\w.*\'" ' + form_path + '/ --include="*.js" --include="*.jsx"\n```'); break; case 'imports': results.push('## Import Path Check\n\nCommand to find old import paths:\n```bash\ngrep -rn "web-component-patterns/" ' + form_path + '/\n```'); break; case 'syntax': results.push('## Syntax Validation\n\nCommand to run linter:\n```bash\nnpm run lint -- ' + form_path + '/\n```'); break; } } return { content: [ { type: 'text', text: '# Validation Report\n\n' + results.join('\n\n'), }, ], }; } - index.js:98-118 (registration)The tool registration for 'validate_form' in the ListToolsRequestSchema handler.
name: 'validate_form', description: 'Run validation checks on a form (schema, syntax, apostrophes)', inputSchema: { type: 'object', properties: { form_path: { type: 'string', description: 'Path to form directory', }, check_types: { type: 'array', items: { type: 'string', enum: ['schema', 'syntax', 'apostrophes', 'imports', 'all'], }, description: 'Types of checks to run', }, }, required: ['form_path', 'check_types'], }, },