# Reading a site without duplicating it

URL: https://kywi-docs-production.up.railway.app/agent/reading-a-site-without-duplicating-it
Type: docPage

`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.

## create_content will not stop you from duplicating something

Creating content is a plain insert. Nothing checks whether a node with the same title or slug already exists — not even two siblings under the same parent. Whatever the content type's own schema doesn't already enforce, the tool doesn't add: two `create_content` calls for "Pricing" under the same parent both succeed and leave two pages behind, and `get_content` by slug then quietly returns whichever one is older, hiding the newer one from that lookup entirely. See [slugs, paths, and moving a page](/authoring/slugs-paths-and-moving-a-page/) for why the store allows it. The existence check above is the only thing standing between a build and a duplicate; the create call itself won't catch it.

## Why this matters for a build

An agent working through [the build-order playbook](/agent/the-order-a-build-wants-to-happen-in/) 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.

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.

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.
