mcp-easy-ai__wp_get_post_blocks
Returns the Gutenberg block tree of a post, page or custom post type item as structured data instead of raw markup — read this before editing blocks with wp_update_post_blocks. Required: post_id. Optional: post_type (REST base, default posts; e.g. pages), depth (levels to expand, default 2, max 10), path (dot-joined zero-based indexes such as 0.2.1; returns only that subtree). Paths count addressable blocks only: named blocks and non-empty classic HTML (reported as core/freeform); the whitespace gaps between blocks are skipped, so three paragraphs are 0, 1, 2. Returns { post_id, block_count (root blocks), blocks: [{ path, name, attrs, inner_html_preview (first 160 chars of the block's own HTML), children_count, children | has_children }] } — children is present within depth, beyond it has_children is set instead. Reads the raw content with edit context, so the same edit_post check as the editor applies. For synced patterns (wp_block posts) use wp_get_block. Through Royally: its server marks it read-only, so it runs straight away.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Dot-joined zero-based path of one block, e.g. "0.2.1". Returns only that block and its subtree; depth counts from it. | |
| depth | No | How many levels of nested blocks to expand (1 = root blocks only). Default 2, max 10. | |
| post_id | Yes | The ID of the post whose blocks to read. | |
| site_id | No | Site to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com) | |
| post_type | No | REST base of the post type (default "posts"; e.g. "pages", "product"). A post_type slug is also accepted. | posts |