bricks_delete_variable_category

Phase 2BeginnerDestructiveComplexity: 2/10
Delete a variable category

Overview

Deletes a global variable category by ID. Variables that belonged to the deleted category become uncategorized — they are NOT deleted, only their category assignment is removed. The variables themselves remain fully functional.

This is useful for cleaning up unused or duplicate categories during a design system reorganization. The variables continue to work as CSS custom properties; they simply lose their grouping in the Bricks builder UI.

Key Features

Non-Destructive for Variables
Deleting a category does NOT delete its variables. Variables become uncategorized and continue to function normally as CSS custom properties.
ID-Based Deletion
Uses the category ID for precise targeting, preventing accidental deletion of the wrong category.

When to Use

Removing duplicate or unused categories during a design system cleanup
Reorganizing the category structure — delete old categories after moving variables to new ones
Cleaning up categories left behind after deleting all their variables
Prerequisites
The category must exist. You need the category_id from bricks_get_variable_categories. Variables in the category will become uncategorized but will NOT be deleted.

When NOT to Use

When you want to delete variables themselves — use bricks_delete_global_variable for each variable
When you want to move variables to a different category — use bricks_update_global_variable to reassign the category first

Parameters

1 Total Parameters1 Required
category_idstringREQUIRED
The unique ID of the category to delete. Obtain this from bricks_get_variable_categories.

Code Examples

Delete an Unused Category

Remove a category that is no longer needed. Its variables become uncategorized.

JSON
// Step 1: List categories
bricks_get_variable_categories({})
// Returns: [{ id: "cat_old", name: "Legacy Tokens" }, { id: "cat_new", name: "Spacing" }]

// Step 2: Delete the legacy category
bricks_delete_variable_category({
  category_id: "cat_old"
})
Response
{"success": true, "message": "Category deleted. Variables in this category are now uncategorized."}

Reorganize Categories

Move variables to a new category, then delete the old one.

JSON
// Step 1: Move variables from old category to new
bricks_update_global_variable({ variable_id: "v1", category: "Design Tokens" })
bricks_update_global_variable({ variable_id: "v2", category: "Design Tokens" })

// Step 2: Delete the now-empty old category
bricks_delete_variable_category({ category_id: "cat_old" })
Response
{"success": true, "message": "Category deleted. Variables in this category are now uncategorized."}

Common Mistakes

Expecting the deletion to also remove the variables in that category.
Category deletion only removes the organizational grouping. Variables become uncategorized but remain fully functional. If you want to delete the variables too, use bricks_delete_global_variable for each one.
Wrong
// Thinking this deletes the spacing variables too
bricks_delete_variable_category({ category_id: "cat_spacing" })
// Variables still exist! They are just uncategorized now.
Correct
// To delete variables AND category:
// First delete each variable
bricks_delete_global_variable({ variable_id: "v1" })
bricks_delete_global_variable({ variable_id: "v2" })
// Then delete the empty category
bricks_delete_variable_category({ category_id: "cat_spacing" })
Deleting a core design system category (like "Spacing") without realizing it disorganizes the variable list.
Avoid deleting standard categories unless you are replacing them. The variables still work but become harder to find in the Bricks UI.
Wrong
bricks_delete_variable_category({ category_id: "cat_spacing" })
// 9 spacing variables are now scattered as uncategorized!
Correct
// Keep the category or create a replacement before deleting
bricks_create_variable_category({ name: "Spacing Scale" })
// Move variables, then delete old category

Tips & Warnings

Tips & Warnings

Variables are preserved: Deleting a category never deletes its variables. They become uncategorized and continue functioning normally.

Reorganize before deleting: If you want to move variables to a new category, use bricks_update_global_variable to reassign each variable before deleting the old category.

Standard categories: Avoid deleting core categories like « Spacing », « Colors », or « Typography » unless you are deliberately restructuring the design system.

Return Values

FieldTypeDescription
successbooleanWhether the category was deleted successfully.
messagestringConfirmation message or error details.

Related Tools

Technical Details

Tool ID
bricks_delete_variable_category
API Endpoint
/bricks-mcp/v1/design-system/variables/categories/{category_id}
HTTP Method
DELETE
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