bricks_create_class_category

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

Overview

Creates a new category for organizing global classes in the Bricks builder UI sidebar. Categories group related classes together (e.g., « Buttons », « Typography », « Cards »), making them easier to browse and apply.

Note that bricks_create_global_class can auto-create categories when a non-existent category name is specified. This tool is useful when you want to pre-create categories before adding classes, or when you need the category ID for other operations.

Key Features

Simple Creation
Takes only a name parameter. Creates the category and returns its ID.
UI Organization
Categories appear in the Bricks builder sidebar, helping designers find and apply classes quickly.

When to Use

When setting up the design system category structure before creating classes
When you need the category ID for filtering or other operations
When organizing a large class library into logical groups
Prerequisites
No prerequisites. However, call bricks_get_class_categories first to avoid creating duplicates.

When NOT to Use

When creating classes with bricks_create_global_class — categories are auto-created from the category name
When a category with the same name already exists — check with bricks_get_class_categories first

Parameters

1 Total Parameters1 Required
namestringREQUIRED
Category display name (e.g., "Layout", "Typography", "Buttons", "Cards", "Utilities").

Code Examples

Create a category for button classes

Creates a "Buttons" category that will group btn-primary, btn-secondary, btn-ghost, etc. in the builder sidebar.

JSON
// Create category for button classes
bricks_create_class_category({
  name: "Buttons"
})
Response
{
  "id": "f1a2b3",
  "name": "Buttons",
  "message": "Class category 'Buttons' created successfully."
}

Common Mistakes

Creating categories one by one when they could be implicitly created during class creation.
When using bricks_create_global_class or bricks_create_classes_batch, just pass the category name — the category is auto-created if it does not exist.
Wrong
// Unnecessary manual category creation
bricks_create_class_category({ name: "Typography" })
bricks_create_class_category({ name: "Buttons" })
bricks_create_class_category({ name: "Cards" })
// Then create classes...
Correct
// Categories auto-created from class batch
bricks_create_classes_batch({
  classes: [
    { name: "text-sm", category: "Typography", settings: { ... } },
    { name: "btn-primary", category: "Buttons", settings: { ... } },
    { name: "card", category: "Cards", settings: { ... } }
  ]
})
// All 3 categories created automatically!

Tips & Warnings

Tips & Warnings

Tip: You rarely need to call this tool directly. The bricks_create_global_class and bricks_create_classes_batch tools auto-create categories when a non-existent category name is specified.

Recommended categories: Layout, Typography, Buttons, Cards, Utilities. For larger projects, also consider: Spacing, Forms, Components, Navigation, Footer.

Return Values

FieldTypeDescription
idstringUnique hex ID of the created category.
namestringThe category name as created.
messagestringSuccess confirmation message.

Related Tools

Technical Details

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

Changelog

v1.0
Initial release — single category creation with auto-ID generation.
20250101