Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: Token Browser 1.0.2 Minor update available for module token_browser (1.0.2). Release: Varbase Project 11.0.8 Minor update available for module varbase_project (11.0.8). Release: Media Remote Image 2.0.0-beta1 First beta version released for module media_entity_remote_image (2.0.0-beta1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Security Coverage: Module Scout Module module_scout now has official Drupal security advisory coverage.

Tool Layout Builder

No security coverage

Part of the Tool ecosystem · 5 projects

View on drupal.org

This module provides tools to programmatically manage Drupal's Layout Builder, allowing systems to discover available layout components and blocks. It can create entire layouts or make incremental edits to existing ones, making it suitable for AI assistants or external integrations that need to build and update pages automatically.

Tool - Layout Builder provides Tool API plugins for working with Drupal Layout Builder programmatically. It is designed for systems that need to discover available building blocks and section layouts, create complete layouts, or edit existing layouts incrementally.

Features

This module provides 3 Tool plugins:

  • tool_layout_builder:get_layout_builder_blocks

    Returns available inline block types, their field schemas, allowed values where available, and available section layouts. This is the discovery step used before building or editing a layout.
  • tool_layout_builder:set_entity_layout

    Sets a complete Layout Builder override on an entity. This replaces the entire layout and is intended for first-time page creation or full rebuilds.
  • tool_layout_builder:edit_entity_layout

    Applies incremental operations to an existing layout. Supported actions are add_section, remove_section, add_block, update_block, and remove_block.

The module is intentionally entity-agnostic. It does not assume nodes, specific bundles, or project-specific block types.

Typical use cases:

  • AI assistants that build or update Layout Builder pages
  • external systems that need structured discovery of available block types
  • custom automation that creates unpublished drafts or assembles landing pages
  • incremental layout editing without manually rebuilding the whole page

The module also supports field structures from the custom_field module by passing values as arrays of row objects keyed by the custom field’s column names.

Post-Installation

This module does not add a user-facing configuration page.

After installation, it exposes Tool API plugins that can be used by compatible consumers such as AI/function-calling systems or custom integrations.

To use the module effectively:

  1. Enable Layout Builder on the target entity type/bundle.
  2. Ensure the entity stores Layout Builder overrides.
  3. Call tool_layout_builder:get_layout_builder_blocks first to discover valid block types, field schemas, and section layouts.
  4. Use tool_layout_builder:set_entity_layout to create a full layout, or tool_layout_builder:edit_entity_layout to make incremental changes.

The write tools save Layout Builder override data directly to the entity.

Additional Requirements

  • Drupal core with layout_builder
  • block_content
  • Tool

These are declared as module dependencies.

  • layout_builder_browser if you want discovery to respect a curated allowlist of inline blocks
  • custom_field if your block types use structured multi-column field data
  • AI/function-calling consumers that can invoke Tool API plugins

Similar projects

This module is not a Layout Builder UI enhancement. It does not provide a visual page builder interface for editors.

Instead, it focuses on a programmatic API surface via Tool API plugins. Its main differentiator is that it exposes Layout Builder discovery and write operations in a structured format suitable for automation, AI assistants, and external orchestration layers.

Supporting this Module

Issues, patches, and feedback are welcome.

Documentation

The module includes technical documentation in its README and API documentation in tool_layout_builder.api.php.

Extension points are available so site-specific modules can:

  • alter discovered field metadata
  • normalize or validate field values before inline blocks are saved

Two generic alter hooks are available:

  • hook_tool_layout_builder_field_info_alter()
  • hook_tool_layout_builder_field_values_alter()

Notes and limitations

  • set_entity_layout replaces the entire layout.
  • edit_entity_layout updates blocks by index, which is practical for automation but not intended as a stable external identifier scheme.
  • Field validation depends on discovered schema plus any installed alter hooks.
  • Project-specific field semantics are intentionally out of scope and should be handled by extension modules.

🤖 Assisted Development

This module is maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully reviewed by the maintainers to ensure that quality and security standards are met.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Jun 2026
Latest release
3 days ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta1 Pre-release 10–11 Sep 9, 2026
1.0.0-alpha4 Pre-release 10–11 Sep 8, 2026
1.0.0-alpha3 Pre-release 10–11 Sep 7, 2026
1.0.0-alpha2 Pre-release 10–11 Jun 9, 2026
1.0.0-alpha1 Pre-release 10–11 Jun 9, 2026
1.0.x-dev Dev 10–11 Jun 9, 2026