polish
Suggests intent-aware refinements that elevate VALID code toward the design system's declared principles.
Reference
Parameters
- Name
code- Type
- string · required
- Description
The code to polish (a single component or page)
- Name
layerId- Type
- string · optional
- Description
Layer UUID for layer-specific principle resolution (uuid)
Returns
{
refinements[] { principle, observation, suggestion, reason, priority }
summary
principlesConsidered
}
Description
Suggests intent-aware refinements that elevate VALID code toward the design system's declared principles.
A judgment-level tool, distinct from validate_code/audit (which find rule violations) and apply_fix/simplify (which apply deterministic transforms). polish grounds one Claude call on the design system's declared principles + anti-patterns and returns refinements, each tied to a named principle. It does not invent generic best-practices and does not rewrite code.
Requires a connected design system WITH declared principles (honest empty state otherwise) and the model gateway (degrades loudly if unavailable).
Parameters:
- code (required): the code to polish (a single component or page)
- layerId (optional): resolve principles for base + this layer
Source
Defined in packages/mcp/src/tools.ts.
The request handler lives alongside its registration in packages/mcp/src/tools/.