Get a collection's tree
get_collectionOn one site of the account, named in site. One collection and its pages in tree order: each page, then the pages under it, each level by title. A page has its id, title, slug, status, language, parent_id, depth (1 at the top), level (the name of its depth), public address and, where its level names fields, their values. Narrow it to one language or to the published pages. The ids go to get_post, the writing tools, and add_collection_pages as parent_id.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site": "<site>",
"collection": "<collection>"
},
"name": "get_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | The site to work on, as list_sites names it | |
| language | No | A BCP 47 tag: only the pages in it | |
| published | No | true for the published pages alone, as readers find them | |
| collection | Yes | Its id, slug or name |