GCBGutenberg
Control Blocks
Buy

AI workflows

AI workflows

WordPress 7.0 provides a standardized function-calling API for AI agents Abilities API, and gcb-lite exposes Gutenberg blocks through that API so an AI can discover available blocks, fill in their fields, preview them, and save them to WordPress using validated schemas rather than guessing or automating the admin UI.

WP core ships the bus (/wp-json/wp-abilities/v1/…), not a chat UI. The wp-admin chat sidebar you might be picturing is plugin territory — gcb-lite registers the typed actions; any AI client (Claude Desktop, a custom agent, a WP chat plugin like AI Engine) can discover and call them.

Abilities we register

Three abilities under the gcblite category. The Abilities API exposes them at /wp-json/wp-abilities/v1/abilities/{name}/run — POST for actions with side effects, GET for read-only data. The input always nests under an input key.

gcblite/list-blocks

Returns every registered gcb/* block on the site, with each block's attribute schema and defaults. Use this first to discover what's available before composing or rendering anything.

Shell
curl -X POST https://your-site.com/wp-json/wp-abilities/v1/abilities/gcblite/list-blocks/run \
  -H "Content-Type: application/json" \
  -d '{ "input": {} }'

Response:

JSON
{
  "blocks": {
    "gcb/saas-banner": {
      "attributes": {
        "eyebrow":  { "type": "string", "default": "" },
        "heading":  { "type": "string", "default": "Built with GCB" },
        "cta_url":  { "type": "object", "default": { "url": "", "text": "" } },
        "...": "..."
      }
    },
    "gcb/saas-projects":     { "attributes": { /* ... */ } },
    "gcb/field-showcase":    { "attributes": {} }
  }
}

Permission: __return_true — the schema is the same thing the editor already exposes to logged-in authors and isn't sensitive.

gcblite/render-block

Renders a single block to HTML server-side. Either runs the block's render.php (if one exists) or fetches the React component-server's SSR output. Same code path as the editor preview. Returns the rendered HTML plus any wrapper attributes the renderer asked for.

Shell
curl -X POST https://your-site.com/wp-json/wp-abilities/v1/abilities/gcblite/render-block/run \
  -H "Content-Type: application/json" \
  -d '{ "input": {
    "blockName": "gcb/saas-banner",
    "attributes": {
      "eyebrow": "Beta",
      "heading": "Typed Gutenberg fields from a JSON file"
    }
  }}'

Permission: edit_posts — render performs an outbound HTTP call to the component server and writes a transient cache, so it's gated against anonymous abuse.

gcblite/get-control-docs

Returns the structured documentation for a single control type — description, stored shape, supports list, config options, gotchas, example. Same canonical source as the docs site (one markdown file per control under schemas/controls/).

Read-only, so use GET. Pass input[type]=color for a specific control, or omit type to list every documented control.

Shell
# Get one control's full reference
curl 'https://your-site.com/wp-json/wp-abilities/v1/abilities/gcblite/get-control-docs/run?input%5Btype%5D=color'

# List every documented type
curl 'https://your-site.com/wp-json/wp-abilities/v1/abilities/gcblite/get-control-docs/run'

Response (with type=color):

JSON
{
  "docs": {
    "type": "color",
    "description": "Color picker pulling its palette from the active theme.json...",
    "stored": "string — hex like \"#5956E9\", a theme palette slug, or a CSS gradient string...",
    "supports": [ "Theme palettes...", "Gradients...", "Dual-attribute mode..." ],
    "configOptions": [
      { "name": "showGradients", "type": "boolean", "default": false, "description": "..." }
    ]
  }
}

Permission: open. The docs are published anyway; no point gating the API behind auth when an LLM could just scrape the docs site instead.

The agent loop

A useful pattern an agent can run end-to-end:

  1. Discover — call gcblite/list-blocks. Now the agent knows the block menu and each block's typed shape.
  2. Compose — pick a block + attribute values that fit the user's ask. The schema constrains what the LLM can output; invalid attribute shapes get caught by the input validator on the call below.
  3. Preview — call gcblite/render-block to get the HTML back without writing to the database. Show it to the user, ask "does this look right?"
  4. Persist — once approved, the agent uses wp/v2/<post-type> to write the composed block markup into a post or page. This step is plain WP REST, no ability needed.

The Abilities API gives you a stop-checking-types-and-just-call-it primitive on top of WP's usual REST endpoints. Everything an LLM sends is validated against the registered input_schema; everything it gets back conforms to output_schema. No hallucination-driven 500s.

Schemas as prompt context

Every block.fields.json in your theme is plain JSON on disk. That's deliberate — it means an LLM with file access (Cursor, Claude with the filesystem tool, an MCP client with file-tools) can read your block schemas as part of its prompt without needing to call an API.

Pattern: paste a block.fields.json into the model and ask it to write the matching React component. The schema defines exactly what props it'll receive (control attributeKeys become prop names; stored value shapes documented in schemas/controls/{type}.json tell it what each prop looks like). Short, structured prompt in, working component out.

MCP clients

Model Context Protocol clients (Claude Desktop, etc.) discover WordPress abilities via a compatible MCP adapter plugin. We don't ship one — there are several to choose from in the plugin ecosystem already, and they all read the same /wp-abilities/v1 registry. Install one, point the client at your site, and our two abilities appear alongside whatever else is registered.

Auth: gcblite/render-block requires edit_posts. MCP clients calling it need application passwords (or equivalent) attached. The list endpoint is unauthenticated; the run endpoint isn't.

Registering your own abilities

Your theme or a companion plugin can register more abilities the same way — anything that operates on gcb-lite blocks (publish flow, content audit, bulk re-render, etc.) is a natural fit. Standard wp_register_ability() call inside the wp_abilities_api_init action.

PHP
add_action('wp_abilities_api_init', function () {
    wp_register_ability('mytheme/publish-with-banner', [
        'label'        => 'Publish post with banner',
        'description'  => 'Compose a post + a gcb/saas-banner header in one go.',
        'category'     => 'gcblite',
        'input_schema' => [
            'type'       => 'object',
            'properties' => [
                'title'   => [ 'type' => 'string' ],
                'eyebrow' => [ 'type' => 'string' ],
            ],
            'required'   => ['title'],
        ],
        'output_schema'    => [
            'type'       => 'object',
            'properties' => [ 'post_id' => [ 'type' => 'integer' ] ],
        ],
        'execute_callback' => function ($input) {
            // Compose markup, wp_insert_post, return id.
        },
        'permission_callback' => function () {
            return current_user_can('publish_posts');
        },
    ]);
});

Why this matters

WP shipped a typed function bus. That solves the "how does an AI call WordPress" problem at the protocol layer. The question becomes: what do the typed functions actually operate on? Core attributes are string, number, boolean, object, array. Useful, but blunt. An LLM generating an object isn't generating an image-with-focal-point or a repeater of testimonials.

gcb-lite's typed-field layer is the structured schema an AI agent needs to compose against. The Abilities API is the callable surface. Together: an agent can list available blocks, compose one with real focal points and gallery items and post-object references, preview it, and ship it — without your site shipping an ounce of bespoke AI code.

Abilities in the code

Reference, generated from the plugin source

GCB registers 8 abilities with the WordPress Abilities API (WordPress 7.0+; skipped where wp_register_ability() does not exist). Each runs at /wp-json/wp-abilities/v1/abilities/{name}/run, with its input under an input key. Read from includes/Abilities/AbilitiesRegistry.php.

AbilityWhat it doesAccessRead-only
gcblite/list-blocksList GCB Lite blocksPublicYes
gcblite/render-blockRender a GCB Lite blockNeeds edit_postsNo
gcblite/create-blockCreate a GCB block (typed fields)Needs edit_themes or edit_theme_optionsNo
gcblite/get-control-docsGet control type docsPublicYes
gcblite/list-controlsList field typesPublicYes
gcblite/check-blocksCheck blocks against their field contractsPublicYes
gcblite/check-triggersCheck a triggers scriptPublicYes
gcblite/get-concept-docsGet GCB concept docsPublicYes

gcblite/list-blocks

Returns every registered gcb/* block on the site, with each block's attribute schema and default values. Useful for discovering what blocks are available before composing or rendering one.

No input.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:105

gcblite/render-block

Renders a single gcb/* block to HTML server-side using the same path as the editor preview. Either runs the block's render.php (if the theme defines one) or fetches the component-server's React output. Returns the rendered HTML plus any wrapper attributes the renderer asked for.

InputTypeRequiredDescription
blockNamestringYesFull block name, e.g. "gcb/text-image".
attributesobjectAttribute values. Use gcblite/list-blocks to discover the available keys + defaults.
innerBlocksarrayNested blocks in parser shape ({ blockName, attrs, innerBlocks }). Only required for blocks that have inner content.

Access: Needs edit_posts. Source: includes/Abilities/AbilitiesRegistry.php:148

gcblite/create-block

InputTypeRequiredDescription
namestringBlock slug (no "gcb/" prefix): lowercase letters, digits, hyphens, starting with a letter. E.g. "team-card".
titlestringHuman-readable block title shown in the editor inserter. E.g. "Team Card".
descriptionstringOptional one-line description of the block.
iconstringOptional dashicon or core block icon. Defaults to "core/layout".
categorystringOptional editor category (e.g. "widgets", "media", "design"). Defaults to "widgets".
fieldsarrayThe typed fields this block exposes. THIS is how block content is modelled in GCB — not as hardcoded markup. Each field becomes an editor control + an attribute the render template reads.
forcebooleanOverwrite an existing block directory of the same name. Defaults to false.
dryRunbooleanIf true, validate + return the files that WOULD be written without touching disk.

Access: Needs edit_themes or edit_theme_options. Source: includes/Abilities/AbilitiesRegistry.php:210

gcblite/get-control-docs

Returns the structured documentation for a single gcb-lite control type — description, stored shape, supports list, config options, gotchas, and an example snippet. Same canonical source as the docs site (gcb-lite/schemas/controls/{type}.md). When called without a type, returns the full list of available control types.

InputTypeRequiredDescription
typestringControl type slug, e.g. "color" or "image". Omit to list every control type that has docs.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:382

gcblite/list-controls

Every field type this site can use in a block.fields.json — built-in, gcb-lite's own, and any a theme or plugin registered — with the value it stores (string, number, boolean, object, array), where it comes from, and its one-line description. Documented types come first: those are the ones with full docs (call gcblite/get-control-docs with the type for options, gotchas and an example). Use only these types; anything else is refused when the block is registered.

No input.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:438

gcblite/check-blocks

Checks gcb/* blocks for fields that are valid on their own but missing what they need from the block around them — e.g. a pin-map field with no repeater child to place, or a child without the point field it writes to. Call it after creating or changing a block. Returns one entry per problem, naming the block, the field and what to fix; an empty list means every field has what it needs.

InputTypeRequiredDescription
blocksarrayBlock names to check, e.g. ["gcb/hero"]. Omit to check every gcb/* block.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:479

gcblite/check-triggers

Checks a Layout block's triggers script (what its boxes do as the page scrolls: hold #photos, cycle #photos with.step, opacity.step from 0 while.step[0%-35%]) and returns each problem as a sentence; none when it is sound. The language and worked examples: get-control-docs "triggers".

InputTypeRequiredDescription
scriptstringYesThe script, a statement a line.
boxesarrayOptional: the names there are, so a name that is not there is caught — an id ("photos") or { "id": "listen", "classes": ["step"] }.
slidersarrayOptional, with boxes: the ids of those that are sliders.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:528

gcblite/get-concept-docs

InputTypeRequiredDescription
namestringConcept page name, e.g. "blocks-inner" or "tokens". Its docs-site slug ("blocks/inner") works too. Omit to list every page.

Access: Public. Source: includes/Abilities/AbilitiesRegistry.php:564

Docs for AI models

This documentation is also published for language models: llms.txt lists every page, and llms-full.txt is all of it in one plain-text file. Point an agent such as Claude Code at either before it writes a block.

Built from GCB Lite 0.4.0 (ce232d4). Source: includes/Abilities/AbilitiesRegistry.php.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.