Repository navigation
Conversation
MCP requires structuredContent to be a JSON object; list_commits returned a top-level array and pull_request_read returned its files/commits/reviews/ comments arrays directly, so strict clients rejected the payload (expected record, received array). Wrap both in named object fields. Tests are being updated in follow-up commits.
pull_request_read list methods and list_commits now return their arrays under a named key in structuredContent, so update the typed-output expectations. Legacy text keeps the bare array, and the schema samples now include the enveloped objects (and reject bare arrays).
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
Wrap the array results of
list_commitsand thepull_request_readlist methods in a named object field, sostructuredContentis always a JSON object as the MCP schema requires.Why
Fixes #3559
For protocol era
2026-07-28, both tools advertise anoutputSchemaand returnedstructuredContentas a top-level JSON array. Strict clients reject that payload (expected record, received array) because MCP definesstructuredContentas an object.What changed
list_commitsnow returns{"commits": [...]}; handler error paths return an emptyListCommitsOutput.pull_request_readnow returns{"files": [...]},{"commits": [...]},{"reviews": [...]}, or{"comments": [...]}depending onmethod, and its output schema offers one required-key object variant per list method instead of a single top-level array variant.outputSchema, as before. Modern JSON text serializes the same enveloped object asstructuredContent.list_commits/pull_request_readtool snapshots.README.mdanddocs/typed-tool-schemas.md.MCP impact
Only the supported
2026-07-28era changes shape;2025-11-25and unknown versions are unchanged. The returned data is the same, just enveloped.Prompts tested (tool changes only)
Exercised through in-process MCP sessions in
typed_repository_commit_outputs_test.go,typed_consolidated_pull_request_outputs_test.go, andtyped_compatibility_test.go:list_commitswith and withoutfields, plus empty and null GitHub responsespull_request_readwithmethod: get_files,get_commits,get_reviews,get_comments, includingafterpagination and empty resultsEach case asserts that modern
structuredContentis an object, validates it against the advertisedoutputSchema, and leaves legacy text byte-identical.Security / limits
fieldsprojections are unchanged; only the JSON envelope changes.Tool renaming
Lint & tests
./script/lint./script/testgo test ./...passes locally.-raceneeds a C compiler that this Windows checkout does not have, so CI will be the first-racerun.Docs