Skip to content

Reading a site without duplicating it

`list_content` pages results with an explicit `hasMore` flag — stopping at the first page and creating instead of finding is the mistake it guards against.

list_content defaults to ten rows per page and never returns more than a hundred, however large the underlying list is — reading the whole thing means paging, and knowing whether you've finished paging means checking one field.

hasMore is the field that answers it

Every response carries total, page, pageSize and hasMore alongside the rows. While hasMore is true, you have not seen every row and the next page is a real page value away, not an assumption. A query for "every product" that reads the first page, sees ten rows, and stops there has answered "the first ten products," not the question it was asked — and nothing about the response format warns you that happened unless you check the flag.

The cheap way to check whether something already exists

Don't page through a whole list to find out whether one node exists. Passing slug or path to list_content and reading total answers that in one call — a matching row means total is at least 1, and no match means it's exactly 0. get_content does the same for a single known id or slug, and fails plainly — "Content not found" — when neither matches; there's no fuzzy or near-duplicate lookup behind it, so an exact slug or path is what makes the check work at all.

Why this matters for a build

An agent working through the build-order playbook reads the site tree constantly — checking what's already there before adding to it. Treating a first page of results as the whole site, or skipping the existence check because paging felt unnecessary, is how a build ends up with two "Contact" pages instead of one it just didn't find.

PromptClaude Code
Before creating a new page titled "Pricing", call list_content with type "page" and slug "pricing", and tell me the total before you create anything.

What you should get

The agent calls list_content with the slug filter, reports total: 0 (nothing exists yet, safe to create) or total: 1+ (a page already exists — it should offer update_content on the existing row instead of creating a second one), and does not fall back to paging through every page to look for a match.