v4.0.0: slim tool defs and responses for ~30-55% smaller MCP payloads#6
Merged
Conversation
Token-efficiency overhaul. Verified against live BookStack: tools/list -32%, list endpoints -55-57%, get_recent_changes -51% (also drops N+1 fetches), get_book -31%. Response shape changes (breaking): - Drop redundant fields: direct_link, *_friendly date strings, content_info, contextual_info, change_summary, pagination_hint, location, shelf summary/tags_summary/book_count. - Fix buggy attachment page_url; keep download_url. - Compact JSON (no pretty-print whitespace). - get_recent_changes returns search-response data directly, no per-result book/page/chapter fetches. Tool-def changes: - Remove get_capabilities (redundant with tools/list). - Drop title field (clients key on name). - Trim verbose descriptions and 52 boilerplate param descriptions. - Dedupe advanced-search caveat onto search_content only. Add scripts/bench-context.mjs harness for re-measuring payload sizes against a live BookStack via JSON-RPC over stdio.
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.
Summary
Token-efficiency overhaul. Verified against a live BookStack via
scripts/bench-context.mjs:tools/listsearch_content(5)get_books(5)get_pages(5)get_recent_changes(5)get_shelves(5)get_page(1)get_book(1)Response shape changes (breaking)
direct_link,*_friendlydate strings,content_info,contextual_info,change_summary,pagination_hint,location, shelfsummary/tags_summary/book_count.page_url; keepdownload_url.get_recent_changesreturns search-response data directly — no per-result book/page/chapter fetches.Tool-def changes
get_capabilities(redundant withtools/list).titlefield (clients key onname).search_contentonly.Other
scripts/bench-context.mjsJSON-RPC harness for re-measuring payload sizes against a live BookStack.get_capabilitiesrow.package.jsonandgemini-extension.json.Test plan
npm run type-checkpassesnpm run buildpassessearch_content,search_pages(advanced syntax{type:page}),get_books,get_pages,get_shelves,get_page(content pagination intact),get_book(chapter/page hierarchy intact),get_recent_changesv4.0.0, release workflow publishes to npm with provenance