Validate ICU Message
localization.icu_message_validate
Overview
You send an ICU message pattern and a locale. We parse it, inventory every argument with its inferred usage, measure nesting, and flag a missing other clause, a conflicting argument type, or a pattern that does not parse. requireOtherClause is true unless you turn it off. maxNesting defaults to 20. We never format, never execute custom functions, and never compare a translation. A successful call costs 1 execution credit.
ICU MessageFormat fails at format time when other is missing or the pattern is ill-formed. Parsing first gives a structural answer without executing it.
Reliability
Same pattern, same locale, same ICU version, same answer. LOCALE_INVALID — trigger: locale is POSIX, empty or not a well-formed BCP 47 tag; retryable: no; next: send a hyphenated tag such as en-US. Structural problems return valid false with diagnostics rather than a typed failure.
Context footprint
One pattern in. A successful call costs 1 execution credit.
When to use it
When you hold one ICU pattern and need to know whether it parses and which arguments it declares.
When you want the formatted string, or a comparison against a translation.
Powered by ICU4J MessageFormat parsing (com.ibm.icu:icu4j).
Scope
Non-goals
- Does not format the message with arguments
- Does not compare a source string to a translation
- Does not validate custom functions beyond the ICU version in use
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | ICU MessageFormat pattern to parse without formatting it. |
| locale | string | Yes | BCP 47 language tag used only to canonicalize the result. |
| requireOtherClause | boolean | No | Whether plural and select arguments must include other; omit it for true. |
| maxNesting | integer | No | Maximum argument nesting; omit it for 20. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | Whether the pattern parsed and every structural rule passed. |
| canonicalTag | string | Yes | Canonical BCP 47 tag for the supplied locale. |
| argumentCount | integer | Yes | Distinct arguments inventoried. |
| nestingDepth | integer | Yes | Deepest argument nesting observed. |
| arguments | array | Yes | From 0 through 2000 closed argument rows in first-seen order; empty when the pattern has none. |
| diagnostics | array | Yes | From 0 through 500 diagnostics sorted by path, offset, severity and code; empty when nothing was flagged. |
| truncated | boolean | Yes | Whether the diagnostic list was cut at 500 items. |
| _meta | object | Yes | Closed ICU and CLDR versions used for this answer, with icuVersion and cldrVersion strings. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.icu_message_validate","input":{"message":"{count, plural, one {# file} other {# files}}","locale":"en-US"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("localization.icu_message_validate", {"locale":"en-US","message":"{count, plural, one {# file} other {# files}}"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| LOCALE_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not format the message with arguments
- Does not compare a source string to a translation
- Does not validate custom functions beyond the ICU version in use
- Rendering the greeting with a real name
- Diffing two translations against each other
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "localization.icu_message_validate",
"input": {
"locale": "en-US",
"message": "{count, plural, one {# file} other {# files}}"
}
}Examples
Plural pattern with other
{
"locale": "en-US",
"message": "{count, plural, one {# file} other {# files}}"
}{
"nestingDepth": 1,
"valid": true,
"diagnostics": [],
"truncated": false,
"argumentCount": 1,
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
},
"canonicalTag": "en-US",
"arguments": [
{
"name": "count",
"usage": "PLURAL",
"occurrences": 1
}
]
}Plural pattern missing other
{
"locale": "en",
"message": "{count, plural, one {# file}}"
}{
"nestingDepth": 0,
"valid": false,
"diagnostics": [
{
"code": "MISSING_OTHER_CLAUSE",
"severity": "ERROR",
"message": "A plural or select argument is missing the required other clause.",
"path": "/message",
"location": {
"utf16Offset": 0,
"codePointOffset": 0
},
"source": "squillify"
}
],
"truncated": false,
"argumentCount": 0,
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
},
"canonicalTag": "en",
"arguments": []
}Recommended use cases
- Rejecting a plural pattern that forgot the other clause
- Inventorying argument names before a translator starts work
Avoid for
- Rendering the greeting with a real name
- Diffing two translations against each other
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.