Use the Validation MCP Tools (Developer Preview)
The validation MCP tools assess your components and evaluate them against validator requirements. When the validation workflow is complete, you get a readiness score and a list of identified issues with recommendations.
Validation MCP tools for LWC is available as a developer preview. Feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don't implement functionality in production with these commands or tools.
To use these tools, pass the --toolsets flags as part of the args property of your MCP configuration file and specify experts-validation. Alternatively, pass in the --tools flag with these tool names.
validate_and_optimize- Performs a one-time analysis for guidance to validate and optimize your component.score_issues- Computes a readiness score (0-100) and quality grade.
See Use DX MCP Tools for LWC for configuration details.
When working with these tools using Agentforce Vibes Extension, you must enable the a4d-general-rules-no-edit.md and a4d-lwc-rules-no-edit.md global rules. The a4d-general-rules-no-edit.md rule is enabled by default. For more information on configuring rules in Agentforce Vibes, see Agentforce Rules in the Agentforce Vibes Extension Developer Guide.
The validate_and_optimize tool scores code quality across multiple validators:
- Code Analyzer: run_code_analyzer
- Accessibility: guide_lwc_accessibility
- Security: guide_lws_security
- Data: guide_lds_data_consistency
- LWC best practices: guide_lwc_best_practices
Each validator runs and invokes the score_issues tool, producing a readiness score (0–100) and a quality grade.
Validators are weighted by importance — security issues impact the overall score far more than best-practice issues.
To use this tool, ask about validating your component or app. Example prompts include:
- Validate and score
componentName - Validate and score
componentNamefor accessibility and security - Is my app production-ready?
The score_issues tool is invoked by the validate_and_optimize tool, after the latter tool runs each validator, and again at the end to provide an overall readiness score.
The tool computes a readiness score (0-100) and a quality grade (prototype, draft, review-for-production). You get a list of identified issues with recommendations on how to fix them. You can choose to fix them automatically and re-validate your component.
| Grade | Score | Meaning |
|---|---|---|
review-for-production | ≥ 90 | Ready for human review |
prototype | 60–89 | Functional but has notable issues |
draft | < 60 | Significant issues need addressing |
An issue in your code can be identified as an error, warning, or note. Each issue results in points taken off from the total score.
| Finding | Score | Points Lost |
|---|---|---|
| 1 error | 80 | −20 |
| 1 warning | 96 | −4 |
| 1 note | 100 | ~0 |
Aggregate scoring uses a weighted average across all the validators, weighted based on tier.
| Tier | Weight | Validators |
|---|---|---|
| Blocker | 50 | guide_lws_security |
| Critical | 30 | run_code_analyzer |
| Important | 20 | guide_component_accessibility, guide_lwc_best_practices, guide_lds_data_consistency |
For example, a single security error alone can drop the overall score from 100 to 93.