You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CLI.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ Complete command-line reference for the Workflowy CLI tool.
15
15
-[Available Commands](#available-commands)
16
16
-[get](#workflowy-get)
17
17
-[list](#workflowy-list)
18
+
-[children](#workflowy-children)
18
19
-[create](#workflowy-create)
19
20
-[update](#workflowy-update)
20
21
-[delete](#workflowy-delete)
@@ -261,6 +262,40 @@ workflowy list --all --format=json
261
262
262
263
---
263
264
265
+
### workflowy children
266
+
267
+
List only direct children of a node in stable outline order, with pagination. This command is intended for large nodes where `get` or `list` would return too much data.
268
+
269
+
```bash
270
+
# First page of root children
271
+
workflowy children --format=json
272
+
273
+
# Page through a large inbox
274
+
workflowy children inbox --limit 50 --offset 0 --format=json
275
+
workflowy children inbox --limit 50 --offset 50 --format=json
276
+
277
+
# Filter direct children before pagination
278
+
workflowy children <item-id> --name-filter '^A' --ignore-case --format=json
279
+
280
+
# Return full node metadata, but still omit nested descendants
281
+
workflowy children <item-id> --full --format=json
282
+
```
283
+
284
+
**Options:**
285
+
286
+
| Option | Description | Default |
287
+
|--------|-------------|---------|
288
+
|`--limit <n>`| Maximum direct children to return (max 200) |`50`|
289
+
|`--offset <n>`| Number of matching direct children to skip |`0`|
290
+
|`--full`| Return full node fields instead of compact child objects |`false`|
291
+
|`--name-filter <regex>`| Regex matched against direct child names before pagination | - |
Copy file name to clipboardExpand all lines: docs/MCP.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Connect AI assistants like Claude, ChatGPT, and other MCP-compatible clients to
11
11
-[Workflowy MCP Tools](#workflowy-mcp-tools)
12
12
-[workflowy_get](#workflowy_get)
13
13
-[workflowy_list](#workflowy_list)
14
+
-[workflowy_children](#workflowy_children)
14
15
-[workflowy_search](#workflowy_search)
15
16
-[workflowy_targets](#workflowy_targets)
16
17
-[workflowy_create](#workflowy_create)
@@ -165,6 +166,32 @@ List descendants as a flat list.
165
166
166
167
---
167
168
169
+
#### workflowy_children
170
+
171
+
List only the direct children of a node with stable ordering and pagination. This is the recommended tool for triaging large inboxes or folders because it does not include nested descendants.
172
+
173
+
**Parameters:**
174
+
| Parameter | Type | Description | Default |
175
+
|-----------|------|-------------|---------|
176
+
|`id`| string | Parent node ID or target name | root |
177
+
|`limit`| number | Maximum direct children to return (max 200) |`50`|
178
+
|`offset`| number | Number of matching direct children to skip |`0`|
The existing MCP read tools return a node subtree, flattened descendants, or recursive search results. Large nodes can produce hundreds of kilobytes or more of JSON, which makes it impossible for an AI assistant to enumerate and triage direct children in bounded batches.
6
+
7
+
## Decision
8
+
9
+
Add a dedicated `workflowy_children` MCP tool instead of changing `workflowy_list`.
10
+
11
+
This is the lowest-risk option because existing tool schemas and default output shapes remain unchanged. The new tool has one focused contract: list only direct children of a parent, sort them into stable outline order, then apply filtering and pagination.
12
+
13
+
## Behavior
14
+
15
+
- Default access method is the live direct-children API: `GET /api/v1/nodes?parent_id=<id>`.
16
+
-`method=export` and `method=backup` are available as explicit fallbacks.
17
+
- Results are sorted by `priority` ascending, then `id` ascending before pagination.
18
+
-`name_filter` is a regular expression applied to direct child names before pagination.
19
+
-`limit` defaults to 50 and is capped at 200 to keep tool responses bounded.
20
+
-`offset` is zero-based.
21
+
- The response includes `total`, `limit`, `offset`, `has_more`, and `next_offset` when another page exists.
22
+
23
+
## Compact output
24
+
25
+
The default compact projection returns:
26
+
27
+
-`id`
28
+
-`name`
29
+
-`layoutMode` when present
30
+
-`completed`
31
+
-`has_children` when the source data contains child information
32
+
33
+
The live direct-children API does not expose child counts, so `has_children` is omitted for live API results instead of returning a misleading `false`. Backup/export sources include this field when children were present in the loaded tree.
34
+
35
+
## Response example
36
+
37
+
```json
38
+
{
39
+
"items": [
40
+
{
41
+
"id": "3495d784-5db2-408f-8c4a-7ae1be810d4f",
42
+
"name": "Triage this",
43
+
"layoutMode": "todo",
44
+
"completed": false
45
+
}
46
+
],
47
+
"total": 1000,
48
+
"limit": 50,
49
+
"offset": 0,
50
+
"next_offset": 50,
51
+
"has_more": true
52
+
}
53
+
```
54
+
55
+
## CLI parity
56
+
57
+
Add `workflowy children [<id>]` with the same pagination and filter behavior. The CLI is useful for manual verification and mirrors the MCP capability without changing `get` or `list`.
0 commit comments