Abilities API
On WordPress 6.9 and later, Lazy Blocks registers four abilities. An AI agent or any other client that speaks the Abilities API can list your blocks, read one, create one and update one, without opening the block builder. On older WordPress versions the abilities are not registered and nothing changes.
The abilities belong to the lazy-blocks category and are shown in the REST API, so a client reaches them through the wp-abilities/v1 routes or through an MCP adapter that exposes WordPress abilities.
Abilities
| Ability | What it does | Who can run it |
|---|---|---|
lazy-blocks/list-blocks | Returns every block with its ID, title, status and slug | users with edit_lazyblocks |
lazy-blocks/get-block | Returns one block by ID with all its builder data: controls, code, supports, styles and condition | users with edit_lazyblocks |
lazy-blocks/create-block | Creates a block from a title and optional builder data, and publishes it | users with edit_lazyblocks and publish_lazyblocks |
lazy-blocks/update-block | Changes the title or builder data of a block by ID | users with edit_lazyblocks who can edit that block |
Out of the box only the Administrator has these capabilities. Blocks Screen shows how to grant them to another role.
Block data
get-block returns the block in the format the block builder saves: id, title, status and a data object. create-block and update-block take the same data object. The keys an agent uses most are:
| Key | Holds |
|---|---|
slug | the block name after the namespace, such as pricing-table |
icon | the block icon |
description | the description shown in the block inspector |
keywords | search keywords, separated by commas |
category | the inserter category |
controls | the block controls, keyed by control ID |
code_output_method | html, php or template |
code_frontend_html | the frontend code |
code_editor_html | the editor code |
code_single_output | true when one code is used for the editor and the frontend |
style_block | the block CSS |
style_editor | the editor CSS |
script_view | the frontend JavaScript |
Every other key the builder stores is accepted as well. The ability's own input schema lists all of them.
Creating and updating blocks
A new block takes the builder defaults for every key the agent leaves out. Without a slug, the slug is built from the title, as the builder does.
An update changes only the top-level keys it is given, and replaces each of them whole. To add one control, an agent reads the block with get-block, adds the control to controls and sends the full controls object back. Sending only the new control removes the others.
A slug must use lowercase letters, numbers and dashes, and start with a letter. A slug another block already uses is refused, so two blocks never register under one name.
A block whose code_output_method is php runs its code as PHP on your site. Let an agent create or update blocks only on a site where you would let the same user write PHP in the block builder.