# ICU MessageFormat Validator MCP for AI Agents AI Agent Connect

> ICU MessageFormat Validator prevents broken translation strings by catching syntax errors before they hit production. It identifies unmatched braces, incorrect plural categories, and unescaped quotes in your i18n templates to ensure your globalized UI remains stable.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_IaQlGvSL4zMDdiFv0D4FuL8L3jDEnXfQZ1I61OIc/ai-agent-connect
- **Tags:** icu, messageformat, internationalization, translation, syntax-validator

## Description

You've been there: a small typo in a translation string breaks the entire UI for users in a specific region. It is frustrating to debug nested braces and complex plural logic across hundreds of files. This MCP acts as a safety net for your internationalization workflow. When you are working with your AI client, it can instantly scan your templates to find unmatched brackets or missing categories in select blocks. You can also pull out every variable name used in a string to make sure your backend matches your frontend. By connecting this to the Vinkius catalog, you get an automated way to audit your message formats without manual squinting at code. It turns a tedious debugging session into a quick check that keeps your globalized app running smoothly.

## Tools

### validate_category_logic
Checks that your plural and select blocks use valid categories like one, few, or many. It ensures you never forget the mandatory 'other' category.

### extract_template_variables
Scans your message strings to find every unique variable name used. This helps you keep your interpolation parameters in sync with your code.

### validate_structural_braces
Analyzes brace depth and quote escaping to catch unmatched characters. It prevents syntax errors from corrupting your translation engine.

## Prompt Examples

**Prompt:** 
```
Is this string safe to use: '{count, plural, one {# item} other {# items}}'?
```

**Response:** 
```
Yes, the structure is correct and includes the required 'other' category.
```

**Prompt:** 
```
What variables are in this message: 'Hello {user}, you have {items} messages'?
```

**Response:** 
```
The template uses two variables:

* `user` 
* `items`
```

**Prompt:** 
```
Check this string for errors: '{name, select, male {He} female {She} error}'
```

**Response:** 
```
There is an issue here. The 'select' block is missing the mandatory **'other'** category.
```

## Capabilities

### Catch unbalanced braces
Identify unmatched opening or closing brackets in your templates.

### Verify pluralization logic
Ensure all select and plural blocks contain the required categories.

### Audit variable usage
Extract every unique parameter name used within a string.

### Detect unescaped quotes
Find single quotes that could break your parsing engine.

### Validate category presence
Confirm the mandatory 'other' category exists in all blocks.

## Use Cases

### Broken brace detection
A developer pastes a complex plural string into the agent, and it immediately flags a missing closing brace.

### Variable inventorying
An engineer needs to know which keys to add to their translation JSON, so they ask the agent to list all variables in a specific template.

### Plural logic audit
A localization specialist wants to ensure a new select block follows all rules, and the agent confirms the categories are correct.

## Benefits

- Prevent UI crashes by catching unmatched braces in your templates.
- Ensure all pluralization logic is valid using validate_category_logic.
- Speed up debugging by instantly finding unescaped quotes with validate_structural_braces.
- Keep your backend and frontend in sync by using extract_template_variables to audit parameters.
- Avoid missing 'other' categories that break select blocks during runtime.

## How It Works

The bottom line is you stop shipping broken translation templates.

1. Connect your preferred AI client to the MCP via Vinkius.
2. Provide your ICU MessageFormat strings to your agent.
3. Receive a detailed report on structural errors or a list of extracted variables.

## Frequently Asked Questions

**How can ICU MessageFormat Validator prevent translation errors?**
It catches unmatched braces and bad syntax before they reach production, preventing broken UI elements.

**Can I use ICU MessageFormat Validator to find all keys in a string?**
Yes, you can ask your agent to list every variable name found within the template.

**Does ICU MessageFormat Validator check for pluralization rules?**
It verifies that your categories like 'one' or 'few' are valid and that the mandatory 'other' category is present.

**Will ICU MessageFormat Validator work with my existing AI client?**
Yes, any MCP-compatible client like Claude, Cursor, or Windsurf can use it via Vinkius.

**Can this tool find unescaped quotes in my strings?**
Yes, it specifically checks for single quotes that might break your parsing engine during runtime.

**How does the validator handle single quotes?**
The `validate_structural_braces` tool implements a state machine to track escaping. It recognizes that two consecutive single quotes (double-single-quote) represent a literal single quote, preventing the parser from incorrectly terminating an escaped sequence.

**What happens if I use an invalid category in a plural block?**
If you include an unsupported keyword like 'none' or 'all', the `validate_category_logic` tool will flag a syntax error, identifying the exact character offset where the invalid category was detected.

**Can I use this to find all variables in my translation files?**
Yes, by using the `extract_template_variables` tool, you can provide any ICU string and receive a complete list of all unique variable names found within the template, such as 'userName' or 'itemCount'.