# 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.

:::note
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](/docs/platform/lwc/guide/mcp-intro.md) for configuration details.

:::important
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](https://developer.salesforce.com/docs/platform/einstein-for-devs/guide/devagent-rules.md) in the *Agentforce Vibes Extension Developer Guide*.
:::

These validation tools are also available for use with [Salesforce Multi-Framework](https://developer.salesforce.com/docs/platform/einstein-for-devs/guide/devagent-mcpvalidate.md).

## Validate and Optimize Tool (`validate_and_optimize`)

The `validate_and_optimize` tool scores code quality across multiple validators:

- Code Analyzer: [run_code_analyzer](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/mcp.md)
- Accessibility: [guide_component_accessibility](/docs/platform/lwc/guide/mcp-lwc.md)
- Security: [guide_lws_security](/docs/platform/lwc/guide/mcp-security.md)
- Data: [guide_lds_data_consistency](/docs/platform/lwc/guide/mcp-lds.md)
- LWC best practices: [guide_lwc_best_practices](/docs/platform/lwc/guide/mcp-lwc.md)

Each validator runs and invokes the `score_issues` tool, producing a **readiness score** (0–100) and a **quality grade**.

:::note
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 `componentName` for accessibility and security
- Is my app production-ready?

## Scoring Tool (`score_issues`)

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 |

### Impact of a single issue on a validator's score

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          |

### Validator weights in the overall score

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.
