Repository navigation
MCP: Slice summary reads with document.node depth and childLimit - #405
Merged
Merged
Conversation
…them (review of storytold#405) `depth` / `childLimit` without `summary: true` used to return the whole full-JSON subtree silently; it is now an invalid-params error. docs/mcp.md describes the slice parameters and childCount, the engine test covers fractional values, unsliced reads and limits past the tree, and the CLI stdio sweep reads a sliced group through run_command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
mcp-pagination
branch
from
October 8, 2026 00:50
398b1f6 to
526fc2e
Compare
Member
|
Thanks @fahrim, merged! This is a clean follow-up to #328. Keeping the slicing in the command layer, and reporting
Checked end to end over MCP stdio on a 2,000-child group: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sliced summary reads for large containers.
vectorcraft://object/{id}returns the whole subtree: on a 2,000-object document a group read is 1.5 MB and a layer read 1.8 MB. The cost left after #328 is the reply size itself. This addsdepthandchildLimittodocument.node {summary: true}so agents can read containers in slices.Design (no new commands, no URI changes — slicing lives at the command layer, where the MCP spec leaves it;
resources/readtakes only a URI):depth: child levels included (None: all, the old behavior).0is the node alone.childLimit: children shown per node, top of the stack first (None: all).childCount. With no truncation the output is byte-identical to before (nochildCountappears).depth: -1,childLimit: "many") is rejected with-32602rather than silently reinterpreted.docs/mcp.mdpoint large-container readers atrun_command document.node {id, summary, depth, childLimit}.Measured over stdio on a 2,000-rectangle group, release build:
depth: 0childCount: 2000)childLimit: 10Quality gates: the default path is byte-identical to current main (engine test equates
summary: truewith thedocument.inspectsubtree; live A/B of leaf/group reads matches hash-for-hash), and a new engine test covers nesting (depth: 1shows children while the nested group reportschildCount), limits, and invalid values.cargo xtask ci: all 7 steps pass.