bricks_get_components

Phase 2BeginnerRead OnlyComplexity: 2/10
List all Bricks components with properties

Overview

Lists all Bricks Components (reusable element groups with configurable properties). Returns each component’s structure, properties with defaults and connections, and category. Use this tool to discover existing components before creating new ones or before building pages that need reusable patterns.

Components are the foundation of maintainable Bricks sites. Instead of duplicating element structures across pages, a component defines the structure once and allows per-instance customization through properties. This tool lets you inspect what components already exist.

Key Features

Full Element Tree
Set include_elements to true to see the complete internal element structure of each component, including all nested children and settings.
Property Inspection
Returns all configurable properties for each component, including labels, groups, defaults, and ref-name connections to internal elements.
Category Organization
Components are organized by category, making it easy to find related components (e.g., cards, headers, CTAs).

When to Use

Before creating a new component, to check if a similar one already exists
During Phase 1 (Site Context) to understand the existing component library
When debugging component instances on pages to verify the component definition
Before building a section with repeated cards/patterns to find reusable components
When auditing a site to understand its component architecture
Prerequisites
No prerequisites — this is a read-only tool that works on any Bricks site
Components must have been previously created with bricks_create_component

When NOT to Use

When you need to create a new component — use bricks_create_component instead
When you need to check where a specific component is used — use bricks_get_component_usage

Parameters

1 Total Parameters1 Optional

Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
include_elementsbooleanoptional
Include full element tree for each component (verbose). Set to true to see the internal structure. Defaults to false.
Default: false

Code Examples

List all components (summary)

Get a quick overview of all components without the verbose element trees.

JSON
bricks_get_components({
  include_elements: false
})
Response
{
  "data": [
    {
      "id": "abc123",
      "label": "Category Card",
      "category": "cards",
      "properties": [
        { "label": "Image", "connections": { "card-image": ["image"] } },
        { "label": "Title", "connections": { "card-title": ["text"] } }
      ]
    }
  ]
}

List with full element trees

Inspect the internal structure of all components to understand their element hierarchy.

JSON
bricks_get_components({
  include_elements: true
})
Response
{
  "data": [
    {
      "id": "abc123",
      "label": "Category Card",
      "category": "cards",
      "properties": [...],
      "elements": [
        {
          "id": "root1",
          "name": "div",
          "parent": 0,
          "children": ["child1", "child2"],
          "settings": { "_background": {...}, "_border": {...} }
        }
      ]
    }
  ]
}

Common Mistakes

Duplicating element structures instead of using components
Always run bricks_get_components first to check for existing reusable patterns before building cards or repeated sections manually.
Wrong
// Building 6 identical cards with 10 elements each = 60 elements
{ "type": "div", "settings": { "_background": ..., "_border": ... }, "children": [...] }
// x6 duplicated
Correct
// Check existing components first
bricks_get_components({ include_elements: false })
// Then use componentId + properties for each instance

Tips & Warnings

Tips & Warnings

Performance tip: Use include_elements: false (the default) when you only need to know which components exist. The element tree can be very large for complex components.

Best practice: Run this tool at the start of every project (Phase 1) to understand what reusable patterns are already available before creating new ones.

Return Values

FieldTypeDescription
dataarrayArray of component objects
data[].idstringUnique component ID used with componentId in sections
data[].labelstringComponent display name
data[].categorystringComponent category for organization
data[].propertiesarrayConfigurable properties with labels, groups, defaults, and element connections
data[].elementsarrayFull element tree (only when include_elements=true)

Related Tools

Technical Details

Tool ID
bricks_get_components
API Endpoint
/bricks-mcp/v1/components
HTTP Method
GET
Namespace
components
Source File
components/components.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101