bricks_list_templates

Phase 1BeginnerRead OnlyComplexity: 2/10
List all Bricks templates with conditions

Overview

Lists all Bricks templates with their type (header, footer, section, archive, search, error, popup, WooCommerce, etc.), display conditions, and an optional summary of their content. Use this to understand the site’s template structure before creating new templates or modifying existing ones.

Key Features

Type filtering
Filter templates by type: header, footer, section, archive, search, error, popup, and 20+ WooCommerce template types.
Condition visibility
Shows display conditions for each template, revealing which pages each template applies to.
Content summary
Optionally includes an element content summary for each template, giving a quick overview without fetching full data.
WooCommerce support
Covers all WooCommerce template types including product, cart, checkout, account, and order templates.

When to Use

At the start of any workflow to understand the existing template structure (Phase 1)
Before creating a new header or footer template to check if one already exists
When debugging template condition conflicts — see which templates apply where
When auditing the site for orphaned or unused templates
Prerequisites
At least one Bricks template must exist on the site

When NOT to Use

When you need the full element tree of a specific template — use bricks_get_template_content instead
When listing regular pages — use bricks_list_pages instead

Parameters

2 Total Parameters2 Optional
typestringoptional
Filter by template type. Use "all" to list every template.
Default: all Values: header, footer, archive, search, error, section, popup, wc_archive, wc_product, wc_cart, wc_cart_empty, wc_form_checkout, wc_form_pay, wc_thankyou, wc_order_receipt, wc_account_dashboard, wc_account_orders, wc_account_view_order, wc_account_downloads, wc_account_addresses, wc_account_form_edit_address, wc_account_form_edit_account, wc_account_form_login, wc_account_form_lost_password, wc_account_form_lost_password_confirmation, wc_account_reset_password, all
include_contentbooleanoptional
Include element content summary for each template.
Default: false

Code Examples


Warning: Undefined array key "example_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 10

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

List all header templates

JSON
{
  "tool": "bricks_get_templates",
  "params": {
    "type": "header",
    "include_content": false
  }
}
Response
{
  "templates": [
    {
      "id": 36,
      "title": "Main Header",
      "type": "header",
      "status": "publish",
      "conditions": [{ "main": "any", "id": "a1b2c3" }]
    }
  ]
}

Common Mistakes


Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Always check bricks_get_templates before creating a new header/footer template. If one already exists with condition "any", creating another may cause conflicts.

Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
If WooCommerce is active, remember to check for WC-specific templates (wc_product, wc_cart, etc.) that may also need updating.

Tips & Warnings

Tips & Warnings

Template conflicts: When multiple templates of the same type match a page, Bricks uses a scoring system. Specific conditions (IDs: score 10) beat general conditions (any: score 2). Use bricks_get_templates to audit condition overlap.

Phase 1 essential: Always run this tool during Phase 1 (Site Context) to understand existing templates before creating new ones.

Return Values

FieldTypeDescription
templatesarrayArray of template objects with id, title, type, status, conditions, and optional content summary.

Related Tools

Technical Details

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

Changelog

v1.0
Initial release
20250101