bricks_create_variable_category

Phase 2BeginnerComplexity: 2/10
Create a new variable category

Overview

Creates a new category for organizing global CSS variables in the Bricks builder UI. Categories group related design tokens together (e.g., « Spacing », « Colors », « Typography ») for easier management and discovery.

Note that categories are also auto-created when you specify a category name in bricks_create_global_variable or bricks_create_variables_batch. This tool is primarily useful when you want to create categories with optional scale configurations (Bricks 2.2+) before adding variables.

Key Features

Scale Configuration (Bricks 2.2+)
Categories can include a scale property that tells Bricks to include variables in this category in the Style Manager CSS file generation.
Organizational Flexibility
Create any number of custom categories to match your design system structure — spacing, colors, typography, borders, shadows, and more.

When to Use

Pre-creating categories with scale configuration before adding variables (Bricks 2.2+)
Setting up the category structure during Phase 2 of a website build
Creating categories that need specific scale properties for Style Manager CSS generation
Organizing variables when you want explicit control over category creation
Prerequisites
Bricks Builder must be active. The category name should not conflict with an existing category name.

When NOT to Use

When you are creating variables with categories — bricks_create_global_variable and bricks_create_variables_batch auto-create categories
When you just need to list existing categories — use bricks_get_variable_categories

Parameters

2 Total Parameters1 Required1 Optional
namestringREQUIRED
Category display name as shown in the Bricks builder UI. Examples: "Spacing", "Colors", "Typography", "Sizing", "Borders", "Shadows".
scaleobjectoptional
Scale configuration object (Bricks 2.2+). When set, variables in this category are included in the Style Manager CSS file generation. The structure depends on the Bricks version.

Code Examples

Create a Spacing Category

Create a category for organizing spacing design tokens.

JSON
bricks_create_variable_category({
  name: "Spacing"
})
Response
{"success": true, "data": {"id": "cat_abc123", "name": "Spacing"}}

Create a Category with Scale (Bricks 2.2+)

Create a category with scale configuration for Style Manager CSS generation.

JSON
bricks_create_variable_category({
  name: "Spacing",
  scale: { "type": "linear", "steps": 9 }
})
Response
{"success": true, "data": {"id": "cat_abc123", "name": "Spacing", "scale": {"type": "linear", "steps": 9}}}

Common Mistakes

Creating categories manually when they would be auto-created by variable creation tools.
You typically do not need this tool if you are using bricks_create_global_variable or bricks_create_variables_batch with category names — those tools auto-create missing categories.
Wrong
// Unnecessary: creating the category manually first
bricks_create_variable_category({ name: "Spacing" })
bricks_create_variables_batch({
  variables: [{ name: "spacing-xs", value: "4px", category: "Spacing" }]
})
Correct
// Category is auto-created — no separate call needed
bricks_create_variables_batch({
  variables: [{ name: "spacing-xs", value: "4px", category: "Spacing" }]
})

Tips & Warnings

Tips & Warnings

Auto-creation is usually sufficient: Categories are automatically created when you specify a category name in bricks_create_global_variable or bricks_create_variables_batch. Only use this tool when you need to set scale configurations.

Standard categories: « Spacing », « Colors », « Typography », « Sizing », « Borders », « Shadows » are the most common organizational groupings.

Scale property (Bricks 2.2+): The scale configuration controls how variables in this category interact with the Style Manager CSS file. Consult Bricks documentation for available scale types.

Return Values

FieldTypeDescription
successbooleanWhether the category was created successfully.
data.idstringThe unique ID assigned to the new category.
data.namestringThe category name as stored.

Related Tools

Technical Details

Tool ID
bricks_create_variable_category
API Endpoint
/bricks-mcp/v1/design-system/variables/categories
HTTP Method
POST
Namespace
design-system
Source File
design-system/variables.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101