Refactor: Add shared schema helpers for pagination, tag, and search params#306
Merged
Conversation
…arams Deduplicates JSON-schema property literals across twprojects (24 files), twdesk and twspaces. New helpers in internal/helpers/schema.go: PageSchema, PageSizeSchema, PageOffsetSchema, OrderBySchema, OrderDirectionSchema, SearchTermSchema, TagIDsFilterSchema, TagIDsAssociateSchema, MatchAllTagsSchema. Existing module-local paginationOptions wrappers in twdesk/twspaces now consume the helpers. Net change: +96 / -687 lines, no behavioural change. Token delta vs main: -6 (essentially flat). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ready4god2513
approved these changes
May 6, 2026
rafaeljusto
reviewed
May 6, 2026
Per PR review feedback. Surfaces the allowed values directly in the schema rather than only in the description, matching the codebase's existing enum pattern (e.g. priority in tasks.go). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rafaeljusto
approved these changes
May 6, 2026
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
internal/helpers/schema.gowith 9 building-block helpers (PageSchema,PageSizeSchema,PageOffsetSchema,OrderBySchema,OrderDirectionSchema,SearchTermSchema,TagIDsFilterSchema,TagIDsAssociateSchema,MatchAllTagsSchema).paginationOptionswrappers in twdesk and twspaces.Notes
search_termblocks in 11 files were left untouched because they carry entity-specific extra wording that flattening would lose.IDParamandDateRangeParamsfrom the original plan were dropped — descriptions vary too much for a clean shared helper. Better suited to PR 4.Part of the tool description simplification effort. Follows #293, #303.
Test plan
gofmt -s -w .go vet ./...go test ./...go run ./cmd/mcp-tokens -base main(delta: −6)🤖 Generated with Claude Code