Install
Works with Drupal: ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Build Drupal Canvas pages with AI agents
Drupal Canvas 1.x has no public API; its authoring code is @internal throughout. Canvas Tools wraps that authoring behavior once, keeps all the coupling to Canvas in two services, and exposes the result as typed Tool API operations. Define the capability once, and every caller gets it: drush tool:run, the AI module through tool_ai_connector, MCP clients through mcp_server_tool_bridge, or your own code. I wrote about why in Define the capability once; call it from anywhere.
Every tool works through Canvas's own auto-save store, the same one the Canvas editor uses. An agent's changes are drafts until something publishes them, and you can review them in the editor first.
What's included
| Area | Tools |
|---|---|
| Find targets and components | canvas_list_targets, canvas_list_components, canvas_get_component_schema, canvas_get_page_tree |
| Edit a component tree | canvas_add_component, canvas_move_component, canvas_delete_component, canvas_update_component_props, canvas_bind_component_props |
| Pages | canvas_create_page, canvas_update_page_metadata, canvas_delete_page, canvas_set_homepage |
| Page templates (Canvas 1.11+) | canvas_create_page_variant, canvas_set_default_page_variant |
| Content templates | canvas_create_content_template, canvas_update_content_template |
| Drafts and publishing | canvas_list_auto_saves, canvas_discard_auto_save, canvas_publish_auto_saves, canvas_update_site_settings |
The module also ships agent skills in .agents/skills for building pages, page templates, content templates and SDC components. They teach an agent the order of operations: look before building, draft, then publish.
Access follows Canvas
The tools apply the same checks as the Canvas editor. That means entity access, edit access to every field a tool writes (including URL aliases), edit access to the component tree field, and view label access on every listed target and draft. Publishing only sends the drafts Canvas lets the user publish. An agent can't do anything the same user couldn't do in the editor.
Requirements
Drupal 11, PHP 8.3, Drupal Canvas 1.7 or later, and Tool API 1.0.0-beta9 or later. Page templates need Canvas 1.11. On Canvas 1.11 and later, theme regions are replaced by page templates, and the tools refuse the page_region target type, with guidance to use a page template instead.
Why beta
Canvas Tools depends on Canvas internals and on Tool API, which is still in beta, so the tool contract may still change before 1.0.0. Two things are still in progress: support for content entities with their own layout (for example, from Canvas Override), and testing against Canvas releases before 1.11. Please try it and open a work item when an agent trips over something.