Skip to main content
Glama

AI Engine for WordPress

Write blocks

wp_write_blocks
Destructive

Write block editor content to an existing post from a list of block specs. Types and fields: paragraph (content), heading (content, level 1-6), list (items, ordered), quote (content, citation), image (url, alt, caption), buttons (buttons: text, url), group (blocks), columns (columns: arrays of blocks), separator, spacer (height), code (content), html (content). mode is replace (default), append or prepend.

Input Schema

NameRequiredDescriptionDefault
IDYesTarget post/page ID (create it first with wp_create_post).
modeNoreplace (default) overwrites post_content; append/prepend add the blocks to the existing content.
blocksYesOrdered array of block specs. Each item is an object with a "type" and the fields for that type (see the tool description).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true and write access; the description adds the concrete consequence by stating the default mode is replace, i.e. existing post_content is overwritten. That is exactly the context an agent needs before a destructive call. It stops short of covering validation failures or whether other post fields are left untouched.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, followed by a dense but necessary block-type catalogue and the mode note. Almost every clause earns its place; the type list is compressed but readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, three-parameter mutation tool with no output schema, the description covers purpose, overwrite semantics, and the block payload vocabulary. Remaining gaps are error/validation behavior and what the call returns, which are secondary but not negligible given the destructive hint.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for top-level params, but the blocks array items are declared as arbitrary objects with the schema explicitly deferring to the description. The description therefore carries the real payload contract by naming 13 block types and their fields. It omits per-type required fields and item formats (e.g. list items as strings, nested group/columns shape), so it is not fully self-sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: "Write block editor content to an existing post from a list of block specs." The block-type enumeration makes it obvious this is block-level content authoring, not a generic post field update. It does not name the nearest sibling (wp_update_post) as the raw-content alternative, so it falls short of full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through "existing post" and the block spec list, and the schema adds "create it first with wp_create_post." But it never says when to prefer this over wp_update_post or wp_alter_post, nor what conditions (post type support for blocks, Gutenberg vs classic editor) make it inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources