Define Excel cell styles using ExcelStyle
mainThe ExcelStyle structure is a JSON schema used to exchange Excel cell styling configurations via MCP. It is based on the Excelize library API and allows you to configure borders, fonts, fills, and number formats.
Key Properties
border: An array ofBorderobjects defining cell edges.font: AFontobject for text styling.fill: AFillobject for background patterns and colors.numFmt: A string representing a custom number format (e.g.,#,##0.00).decimalPlaces: An integer (0-30) specifying the number of decimal places.
Implementation Rules
- Colors: Must use hexadecimal format (
#RRGGBB). - Required Fields: Only
border.typeis strictly required if a border object is provided; all other style properties are optional.
{
"font": {
"bold": true,
"size": 12,
"color": "#000000"
},
"fill": {
"type": "pattern",
"pattern": "solid",
"color": ["#FFFF00"]
}
}