Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

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.

Activity

Total releases
3
First release
Jun 2026
Latest release
4 days ago
Release cadence
0 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-alpha2 Pre-release Jun 9, 2026
1.0.0-alpha1 Pre-release Jun 9, 2026
1.0.x-dev Dev Jun 9, 2026