Catalog: ships_from as a list + cursor pagination on search - #15
Merged
Conversation
The Global UCP catalog changed filters.ships_from from a single
{ country } object to a list of origin objects (shop/world#796951).
The API now rejects the old scalar shape, so this is a required fix.
- shop-client: send filters.ships_from as [{ country }, ...] (OR'd);
--ships-from now takes a comma-separated ISO2 list (e.g. US,CA).
- search: add a --cursor flag and forward pagination.cursor alongside
limit. Each search response footer surfaces the next-page cursor and
estimated total when more results exist; re-run the same query with
--cursor to walk pages.
- --limit still allows up to 50, but guidance favours small pages.
- Docs (SKILL.md, catalog-mcp.md) and tests updated.
joerj123
force-pushed
the
catalog-ships-from-list-and-pagination
branch
from
June 11, 2026 20:19
612f515 to
0d8c356
Compare
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.
What & why
Two catalog changes:
1.
ships_fromscalar → list (required fix)The Global UCP catalog changed
filters.ships_fromfrom a single{ country }object to a list of origin objects (shop/world#796951). The endpoint now rejects the old scalar shape:So the CLI's current
--ships-fromis broken until this lands.filters.ships_fromis now sent as[{ country }, ...](origins OR together).--ships-fromaccepts a comma-separated ISO2 list, e.g.--ships-from US,CA.2. Cursor pagination on
shop search--cursorflag forwardspagination.cursoralongsidelimit.--cursor <cursor>to walk pages (no duplicates, steady totals).--limitstill allows up to 50 (the API max), but it's not recommended — large pages burn tokens. Guidance/help nudge toward small pages (6-8).Docs (
SKILL.md,references/catalog-mcp.md) updated; SKILL.md edits kept ~token-neutral.Testing
Unit tests:
pnpm typecheck && pnpm build && pnpm test→ 85 pass / 0 fail (5 new: ships_from list, cursor forwarding, CLI flag mapping, pagination footer render x2).Manual testing against the live catalog (
catalog.shopify.com):Direct API
ships_from: [{country:"US"},{country:"CA"}]→ 200, returns products +paginationblock. ✅cursor→ distinct products, advanced offset, stable total. ✅ships_from: {country:"US"}→ rejected (confirms the migration). ✅CLI (
--memory-store, unauthenticated)shop search "coffee mug" --ships-from US,CA --ships-to US --limit 3→ real results + footer cursor. ✅--cursor <token>→ page 2, no overlap with page 1. ✅--limit 50→ 50 results;--limit 51→ rejected (expected 1-50). ✅