Repository navigation
feat(mcp): portable input schemas - #19
Merged
Merged
Conversation
Replace inferred multi-type arrays with single-type anyOf branches for all MCP inputs, including nested read_many ranges. Preserve optional nulls, plugin defaults versus explicit empty lists, and existing validation bounds. Require read_many.files to be a non-null array of 1-10 entries. Previously null passed schema validation and failed in the service; it now returns an MCP input-validation tool error before execution. Error text/code at that boundary changes, but null never represented a successful batch operation. Per-item range validation and partial success remain in the service. Add discovery coverage for all 10 tools, schema validation cases and HTTP MCP calls verifying legacy optional-value behavior. Document the contract.
Keep null branches type-only and assert this for every advertised tool. Give the input contract its own documentation section. Valid input semantics remain unchanged; null file batches fail before execution.
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.
MCP input schemas now express nullable fields as single-type
anyOfbranches. Null branches contain only{"type":"null"}; array items and numeric bounds remain on the non-null branches, making the schemas easier for tool adapters to consume.plugins: []still disables enhancements.read_many.filesmust be an array of 1–10 entries.files: nullpreviously passed schema validation and failed in the service; it now returns an MCP input-validation tool error before the handler runs. Clients should inspectisErrorrather than rely on error text/code for invalid input.Validation: MCP package tests, race tests,
go vet, static/web checks and local builds passed. The reviewer independently rango test ./...successfully before the review follow-up. After the follow-up, MCP race tests and package vet passed again. Discovery tests cover all 10 tools, reject multi-type arrays and assert that null branches contain no extra keywords; HTTP tests preserve optional-value semantics and reject null batches before execution.Review follow-up also moves the input-schema contract to its own documentation section. Existing source branch retained to preserve review continuity; squash title is
feat(mcp): portable input schemas.