Skip to content
Integrations

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

AbilityWhat it doesWho can run it
lazy-blocks/list-blocksReturns every block with its ID, title, status and slugusers with edit_lazyblocks
lazy-blocks/get-blockReturns one block by ID with all its builder data: controls, code, supports, styles and conditionusers with edit_lazyblocks
lazy-blocks/create-blockCreates a block from a title and optional builder data, and publishes itusers with edit_lazyblocks and publish_lazyblocks
lazy-blocks/update-blockChanges the title or builder data of a block by IDusers 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:

KeyHolds
slugthe block name after the namespace, such as pricing-table
iconthe block icon
descriptionthe description shown in the block inspector
keywordssearch keywords, separated by commas
categorythe inserter category
controlsthe block controls, keyed by control ID
code_output_methodhtml, php or template
code_frontend_htmlthe frontend code
code_editor_htmlthe editor code
code_single_outputtrue when one code is used for the editor and the frontend
style_blockthe block CSS
style_editorthe editor CSS
script_viewthe 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.

Was this article helpful?

Copyright © 2026 Lazy Blocks.