Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
3aa6234
feat(inventory): add typed MCP tool registration foundation
SamMorrowDrums Oct 2, 2026
0919056
chore: regenerate license files
github-actions[bot] Oct 2, 2026
5aeb60c
test: cover legacy typed CSV results
SamMorrowDrums Oct 2, 2026
6fbbf32
feat(inventory): normalize legacy typed arguments
SamMorrowDrums Oct 2, 2026
7660e82
chore: regenerate license files
github-actions[bot] Oct 2, 2026
ef66529
test(inventory): preserve typed input optionality
SamMorrowDrums Oct 2, 2026
d4603dc
fix(inventory): stabilize typed schema compatibility
SamMorrowDrums Oct 2, 2026
940462d
test(inventory): cover protocol isolation across clients
SamMorrowDrums Oct 2, 2026
40a53bf
fix(inventory): harden typed schema registration contracts
SamMorrowDrums Oct 3, 2026
af44817
fix(inventory): cache warm schemas and guard typed preflight
SamMorrowDrums Oct 3, 2026
734306e
fix(inventory): preserve schema metadata isolation
SamMorrowDrums Oct 3, 2026
34a64ff
fix(inventory): detach numeric schema bounds and dedupe default trave…
SamMorrowDrums Oct 3, 2026
6f10141
fix(inventory): gate typed output on supported protocol range
SamMorrowDrums Oct 3, 2026
892f46f
fix(inventory): unwrap pointer inputs before schema inference
SamMorrowDrums Oct 3, 2026
56c7845
fix(inventory): reuse encoded schema cache for typed tools
SamMorrowDrums Oct 5, 2026
b305efb
feat(context): add typed tool schemas and outputs
SamMorrowDrums Oct 2, 2026
1cf9c62
fix(context): preserve legacy input acceptance
SamMorrowDrums Oct 2, 2026
c476d0f
test(context): preserve input schema roots and optionality
SamMorrowDrums Oct 2, 2026
2165831
fix(context): validate direct team member calls
SamMorrowDrums Oct 2, 2026
6b4dee6
test(context): pin structured output and legacy text fixtures
SamMorrowDrums Oct 3, 2026
a26ac28
fix(context): emit structured empty team collections
SamMorrowDrums Oct 3, 2026
33b7c01
fix(context): preserve legacy team input schemas
SamMorrowDrums Oct 3, 2026
bf35240
fix(context): preserve advertised input schema compatibility
SamMorrowDrums Oct 3, 2026
bae4e60
fix(context): reject explicit null team user arguments
SamMorrowDrums Oct 3, 2026
f027e5d
fix(context): preserve exact routing argument keys
SamMorrowDrums Oct 3, 2026
8566b65
feat(comments): add typed visibility tool inputs and outputs
SamMorrowDrums Oct 2, 2026
f03179d
chore: regenerate license files
github-actions[bot] Oct 2, 2026
9a162f7
chore: regenerate license files
github-actions[bot] Oct 2, 2026
0953a88
test(comments): pin protocol output parity and reason metadata
SamMorrowDrums Oct 3, 2026
10ec2c4
fix(comments): reuse cached visibility output schema
SamMorrowDrums Oct 3, 2026
bd47b37
feat(search): add typed projected result outputs
SamMorrowDrums Oct 2, 2026
07d1845
fix(search): preserve field_values presence and add nested schema fix…
SamMorrowDrums Oct 3, 2026
700739f
test: bound encoded schema parity registration work
SamMorrowDrums Oct 5, 2026
6247847
feat(security): add typed alert outputs
SamMorrowDrums Oct 2, 2026
fa1e8e7
fix(security): preserve compatibility with compact typed outputs
SamMorrowDrums Oct 3, 2026
1e38939
feat: type discussion and notification tool outputs
SamMorrowDrums Oct 2, 2026
cf98009
fix: tighten discussion and notification output contracts
SamMorrowDrums Oct 3, 2026
0f2d5de
test: cover empty-object discussion read requests and modern-text==DT…
SamMorrowDrums Oct 3, 2026
bcd2271
fix(notifications): preserve plain status output content
SamMorrowDrums Oct 3, 2026
971b16d
feat(repos): add typed commit tool outputs
SamMorrowDrums Oct 2, 2026
e95c2a4
fix(repos): restore commit pagination defaults
SamMorrowDrums Oct 2, 2026
e0f12bb
fix(repos): return typed projected commit lists
SamMorrowDrums Oct 2, 2026
bffa91c
chore: regenerate license files
github-actions[bot] Oct 2, 2026
a3473ef
test(repos): snapshot modern commit tools and strengthen wire coverage
SamMorrowDrums Oct 3, 2026
495e401
test(repos): distinguish legacy and modern commit text
SamMorrowDrums Oct 3, 2026
733153c
test(repos): sync commit snapshots with parent DTO metadata
SamMorrowDrums Oct 3, 2026
df025d1
feat(issues): add typed metadata comment and dependency outputs
SamMorrowDrums Oct 2, 2026
b707dd4
chore: regenerate license files
github-actions[bot] Oct 2, 2026
74e3c19
chore: regenerate license files
github-actions[bot] Oct 2, 2026
f2ab4e5
fix(issues): preserve zero pagination for duplicate search
SamMorrowDrums Oct 5, 2026
9a3aef4
refactor(issues): preserve compact typed output contracts
SamMorrowDrums Oct 5, 2026
fddb687
test(issues): bound encoded schema parity registration work
SamMorrowDrums Oct 5, 2026
eaabba8
feat(repos): complete typed repository tool outputs
SamMorrowDrums Oct 2, 2026
aa2f66f
chore(repos): exclude unrelated snapshot formatting drift
SamMorrowDrums Oct 2, 2026
c9e4171
refactor(repos): compact typed repository outputs
SamMorrowDrums Oct 5, 2026
564ec8d
feat(issues): add typed consolidated issue tool contracts
SamMorrowDrums Oct 2, 2026
e87b64d
chore: regenerate license files
github-actions[bot] Oct 2, 2026
3d38902
refactor(issues): minimize consolidated typed outputs
SamMorrowDrums Oct 3, 2026
9d92a52
fix(issues): keep union property schemas portable
SamMorrowDrums Oct 3, 2026
58392b4
test(issues): cover strict sub-issue output variants
SamMorrowDrums Oct 3, 2026
85e2f13
test(issues): pin compact comment user redaction
SamMorrowDrums Oct 3, 2026
2801064
fix(issues): restore main-identical advertised input schema
SamMorrowDrums Oct 3, 2026
8435880
fix(issues): restore protocol output parity
SamMorrowDrums Oct 5, 2026
1973eee
chore: regenerate license files
github-actions[bot] Oct 5, 2026
00fd1b4
refactor(issues): minimize granular structured outputs
SamMorrowDrums Oct 5, 2026
1d5680e
refactor(search): use typed account repository and commit tools
SamMorrowDrums Oct 2, 2026
b1baea0
refactor(search): compact typed repository search output
SamMorrowDrums Oct 3, 2026
0ff085d
refactor(search): expose repository visibility enum
SamMorrowDrums Oct 3, 2026
a2cf3e2
test(search): align snapshots with protocol wrapper
SamMorrowDrums Oct 5, 2026
dc72d96
refactor(pull-requests): migrate consolidated PR tools to typed input…
SamMorrowDrums Oct 2, 2026
10c3679
fix(pull-requests): align modern text with typed outputs
SamMorrowDrums Oct 5, 2026
e3c263e
fix(pull-requests): preserve legacy validation order
SamMorrowDrums Oct 5, 2026
3e0f06a
refactor(pull-requests): simplify compatibility validation
SamMorrowDrums Oct 5, 2026
2341ae0
refactor(pull-requests): type granular MCP tools
SamMorrowDrums Oct 2, 2026
9f33dd6
chore: regenerate license files
github-actions[bot] Oct 2, 2026
8eb52ae
fix(pull-requests): preserve granular tool compatibility
SamMorrowDrums Oct 5, 2026
437f2f0
chore: regenerate license files
github-actions[bot] Oct 5, 2026
95ff601
test(pull-requests): compare schema sets semantically
SamMorrowDrums Oct 5, 2026
94cdd29
fix(pull-requests): retain granular schema descriptions
SamMorrowDrums Oct 5, 2026
8b8ca63
refactor(actions): type consolidated MCP tools
SamMorrowDrums Oct 2, 2026
4a4e24b
feat(actions): add typed Actions tool outputs
SamMorrowDrums Oct 5, 2026
62f2da8
feat(repos): complete typed repository tool outputs
SamMorrowDrums Oct 2, 2026
ce2da89
chore(repos): exclude unrelated snapshot formatting drift
SamMorrowDrums Oct 2, 2026
5a08193
refactor(repos): compact typed repository outputs
SamMorrowDrums Oct 5, 2026
66d1726
feat(issues): add typed consolidated issue tool contracts
SamMorrowDrums Oct 2, 2026
d92f9ba
chore: regenerate license files
github-actions[bot] Oct 2, 2026
54f2dc6
refactor(issues): minimize consolidated typed outputs
SamMorrowDrums Oct 3, 2026
a744d0d
fix(issues): keep union property schemas portable
SamMorrowDrums Oct 3, 2026
5be3afb
test(issues): cover strict sub-issue output variants
SamMorrowDrums Oct 3, 2026
bbe38e6
test(issues): pin compact comment user redaction
SamMorrowDrums Oct 3, 2026
5c2fd9d
fix(issues): restore main-identical advertised input schema
SamMorrowDrums Oct 3, 2026
881e2d4
fix(issues): restore protocol output parity
SamMorrowDrums Oct 5, 2026
f4171db
chore: regenerate license files
github-actions[bot] Oct 5, 2026
e4d0b2f
refactor(issues): minimize granular structured outputs
SamMorrowDrums Oct 5, 2026
addbd8b
refactor(search): use typed account repository and commit tools
SamMorrowDrums Oct 2, 2026
f4ba32d
refactor(search): compact typed repository search output
SamMorrowDrums Oct 3, 2026
9b75ca3
refactor(search): expose repository visibility enum
SamMorrowDrums Oct 3, 2026
389fc36
test(search): align snapshots with protocol wrapper
SamMorrowDrums Oct 5, 2026
d62f05f
refactor(pull-requests): migrate consolidated PR tools to typed input…
SamMorrowDrums Oct 2, 2026
b0d7089
fix(pull-requests): align modern text with typed outputs
SamMorrowDrums Oct 5, 2026
5b0513e
fix(pull-requests): preserve legacy validation order
SamMorrowDrums Oct 5, 2026
c77a3e2
refactor(pull-requests): simplify compatibility validation
SamMorrowDrums Oct 5, 2026
04d7436
refactor(pull-requests): type granular MCP tools
SamMorrowDrums Oct 2, 2026
d3b2ba2
chore: regenerate license files
github-actions[bot] Oct 2, 2026
b0adaaa
fix(pull-requests): preserve granular tool compatibility
SamMorrowDrums Oct 5, 2026
833ae51
chore: regenerate license files
github-actions[bot] Oct 5, 2026
6e5497f
test(pull-requests): compare schema sets semantically
SamMorrowDrums Oct 5, 2026
09c15a1
fix(pull-requests): retain granular schema descriptions
SamMorrowDrums Oct 5, 2026
e6a4a25
refactor(actions): type consolidated MCP tools
SamMorrowDrums Oct 2, 2026
719e8dd
feat(actions): add typed Actions tool outputs
SamMorrowDrums Oct 5, 2026
c690daa
Merge commit '719e8dd2a4cdb5ceeddf16840e4c9b5aaab5c343' into sammorro…
SamMorrowDrums Oct 6, 2026
2dcb32c
feat: consolidate typed tool output layers
SamMorrowDrums Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,17 @@ The following sets of tools are available:

## Tools

Repository tools expose output schemas and typed `structuredContent` to clients using MCP protocol `2026-07-28` or later. Older clients, or clients with an unknown protocol version, receive the existing content without an output schema or structured output.
Repository tools expose output schemas and typed `structuredContent` when the negotiated MCP protocol version is a supported version `2026-07-28` or newer. Older clients, clients with an unknown protocol version, and clients omitting the version receive the existing content without an output schema or structured output. Unknown versions are not treated as supported merely because they sort after `2026-07-28`.

For `get_file_contents`, directory results (including field projections) are structured arrays. File downloads and metadata-only responses use a `content` array of typed text, embedded-resource, or resource-link blocks, preserving status messages, text, base64 blobs, empty files, and download links. Text-only repository mutations such as starring and deletion also return a structured `message`; fork responses distinguish a repository reference from an in-progress message. Repository deletion still requires its existing confirmation flow before returning a completed result.

Structured repository results use compact DTOs rather than raw REST objects. Release lookups share the compact release shape with release listings; Git references retain the ref, object type, and SHA; annotated tags retain tag/message/tagger/target information; deletion commits retain SHA, message, authors, tree SHA, parent SHAs, and a human-facing `html_url` when available. Directory entries retain file metadata and useful HTML/download links, but omit API and hypermedia routing URLs even when those fields were requested in a projection. Legacy and unknown protocol versions retain the original text byte-for-byte; modern text-only JSON responses serialize the same compact DTO as `structuredContent`. Non-text resource blocks and tool errors retain their existing content behavior. Structured projections use the same sanitized and filtered source as the legacy formatter.

The issue metadata (`list_issue_types`, `list_issue_fields`), comment (`add_issue_comment`, `update_issue_comment`), dependency (`issue_dependency_read`, `issue_dependency_write`), and duplicate-detection (`find_duplicate`) tools provide typed `outputSchema` and `structuredContent` for protocol `2026-07-28` and newer. Older or unknown protocol versions retain the same text responses without these fields. Tool errors do not return structured content. Dependency and duplicate-detection tools retain their existing feature gates.
For `get_repository_tree`, `list_gists`, `get_gist`, `create_gist`, and `update_gist`, gist results retain file names, contents, sizes, language/type information, timestamps, visibility, and compact owner profiles, while omitting API/node and Git transport URLs. Tree entries omit their derivable API URLs. Create/update gist results contain the gist ID and HTML URL. Modern JSON text and structured content serialize the same compact result. Older or unknown protocol versions retain byte-for-byte legacy text without an output schema or structured content.

The issue metadata (`list_issue_types`, `list_issue_fields`), comment (`add_issue_comment`, `update_issue_comment`), dependency (`issue_dependency_read`, `issue_dependency_write`), and duplicate-detection (`find_duplicate`) tools provide typed `outputSchema` and `structuredContent` for negotiated supported protocol versions `2026-07-28` or newer. Older or unknown protocol versions retain the same text responses without these fields. Tool errors do not return structured content. Dependency and duplicate-detection tools retain their existing feature gates.

For negotiated supported protocol versions `2026-07-28` or newer, the consolidated Actions tools (`actions_list`, `actions_get`, `actions_run_trigger`) return structured objects with a `method` discriminant and a method-specific typed field; JSON text contains the same compact projection. Workflow, job, and artifact projections omit API/hypermedia URLs while retaining browser links and useful identifiers, states, timestamps, and usage durations. Run usage lists billable runner environments in deterministic name order. Older and unknown-protocol text responses remain unchanged; `get_job_logs` retains its typed content, URL, or failed-job collection variants.

<!-- START AUTOMATED TOOLS -->
<details>
Expand Down
10 changes: 6 additions & 4 deletions docs/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ return ghErrors.NewGitHubGraphQLErrorResponse(ctx, message, err), nil
### Typed Tool Results

Tools registered with concrete `NewTool[In, Out]` types expose output schemas and
`structuredContent` only when the negotiated protocol is `2026-07-28` or newer.
Older or unknown protocols retain the original text responses without these
typed-output additions. Ordinary API and validation errors never expose the
SDK-generated zero-value structured output.
`structuredContent` when the negotiated protocol version is a supported version
`2026-07-28` or newer. Older, unknown, or omitted protocol versions retain the
original text responses without these typed-output additions. Unknown versions
are not treated as supported merely because they sort after `2026-07-28`.
Ordinary API and validation errors never expose the SDK-generated zero-value
structured output.

Handler-provided structured statuses are distinct from generated error output.
For example, `issue_write` can return `IsError: true` with
Expand Down
18 changes: 9 additions & 9 deletions docs/feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,23 @@ as output formatting) won't appear here.
- `path`: The relative path of the file to comment on (string, required)
- `pullNumber`: The pull request number (number, required)
- `repo`: Repository name (string, required)
- `side`: The side of the diff to comment on (LEFT or RIGHT, optional) (string, optional)
- `side`: The side of the diff to comment on (optional) (string, optional)
- `startLine`: The start line of a multi-line comment (optional) (number, optional)
- `startSide`: The start side of a multi-line comment (LEFT or RIGHT, optional) (string, optional)
- `subjectType`: The subject type of the comment (FILE or LINE) (string, required)
- `startSide`: The start side of a multi-line comment (optional) (string, optional)
- `subjectType`: The subject type of the comment (string, required)

- **add_pull_request_review_comment_reaction** - Add Pull Request Review Comment Reaction
- **OAuth Challenge Scopes**: `repo`
- `comment_id`: The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...). (number, required)
- `content`: The emoji reaction type (+1, -1, laugh, confused, heart, hooray, rocket, or eyes) (string, required)
- `content`: The emoji reaction type (string, required)
- `owner`: Repository owner (username or organization) (string, required)
- `repo`: Repository name (string, required)

- **create_pull_request_review** - Create Pull Request Review
- **OAuth Challenge Scopes**: `repo`
- `body`: The review body text (optional) (string, optional)
- `commitID`: The SHA of the commit to review (optional, defaults to latest) (string, optional)
- `event`: The review action to perform (APPROVE, REQUEST_CHANGES, or COMMENT). If omitted, creates a pending review. (string, optional)
- `event`: The review action to perform. If omitted, creates a pending review. (string, optional)
- `owner`: Repository owner (username or organization) (string, required)
- `pullNumber`: The pull request number (number, required)
- `repo`: Repository name (string, required)
Expand Down Expand Up @@ -300,7 +300,7 @@ as output formatting) won't appear here.
- **submit_pending_pull_request_review** - Submit Pending Pull Request Review
- **OAuth Challenge Scopes**: `repo`
- `body`: The review body text (optional) (string, optional)
- `event`: The review action to perform (APPROVE, REQUEST_CHANGES, or COMMENT) (string, required)
- `event`: The review action to perform (string, required)
- `owner`: Repository owner (username or organization) (string, required)
- `pullNumber`: The pull request number (number, required)
- `repo`: Repository name (string, required)
Expand Down Expand Up @@ -341,7 +341,7 @@ as output formatting) won't appear here.
- `owner`: Repository owner (username or organization) (string, required)
- `pullNumber`: The pull request number (number, required)
- `repo`: Repository name (string, required)
- `state`: The new state for the pull request (open or closed) (string, required)
- `state`: The new state for the pull request (string, required)

- **update_pull_request_title** - Update Pull Request Title
- **OAuth Challenge Scopes**: `repo`
Expand Down Expand Up @@ -402,8 +402,8 @@ as output formatting) won't appear here.
- `confidence_threshold`: Minimum similarity threshold a candidate must meet to be returned; higher values are stricter. When omitted, the API's high-precision default is used. The scale is defined by the API, so no client-side bounds are enforced. (number, optional)
- `issue_number`: The number of the existing issue to find duplicates for (number, required)
- `owner`: The owner of the repository (string, required)
- `page`: Page number for pagination (min 1). An explicit 0 is forwarded to the API as-is rather than being replaced with 1. (number, optional)
- `perPage`: Results per page for pagination (min 1, max 100). An explicit 0 is forwarded to the API as-is rather than being replaced with 30. (number, optional)
- `page`: Page number for pagination (min 1) (number, optional)
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
- `repo`: The name of the repository (string, required)

### `thread_resolution_reason`
Expand Down
23 changes: 17 additions & 6 deletions docs/typed-tool-schemas.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Typed tool schemas

Typed tool registrations use concrete Go input and output types with the MCP
Go SDK's `mcp.AddTool` path. The SDK infers schemas when the tool definition
does not provide them, validates arguments before the handler runs, and
validates typed output. Keep business rules that JSON Schema cannot express
Go SDK's `mcp.AddTool` path. Inventory infers missing schemas and validates
arguments against the cached input schema before the handler runs; the SDK
adapts and validates typed output. Keep business rules that JSON Schema cannot express
in the handler or a preflight callback.

Input inference unwraps one pointer level, matching the SDK's object input
Expand Down Expand Up @@ -31,13 +31,13 @@ schemas; do not mutate the returned pointers.

When compatibility requires a broader runtime input contract than the one
advertised to clients, provide `ValidationInputSchema`. The tool's declared
`InputSchema` remains visible while the SDK validates calls against the
`InputSchema` remains visible while inventory validates calls against the
runtime-only schema. Use `Preflight` for checks that need raw arguments or
request dependencies before typed decoding; it may return a derived context
for the handler. Input normalizers are only for compatibility transformations,
not a replacement for schema validation.

The SDK applies defaults from the runtime input schema before decoding. If an
Inventory applies defaults from the runtime input schema before decoding. If an
omitted field must remain omitted, build the runtime schema with
`inventory.CloneSchemaWithoutDefaults` before applying validation-only
changes. Use `inventory.CloneSchema` when deriving other runtime-only schema
Expand All @@ -46,6 +46,14 @@ subschemas. Default removal visits each child once per parent. The advertised
schema can retain its defaults; the constructor caches the runtime schema
without mutating either caller-owned schema.

Availability and authorization guards run before preflight, normalization,
and input validation. A guard or preflight result is passed through the
registered SDK handler without decoding the original arguments or invoking
user code, so the SDK still finalizes multi-round-trip results with
`resultType: "input_required"` (or `"complete"`). The permissive SDK input
envelope used for this handoff is never advertised and does not replace the
original validation schema for real calls.

The output schema and `structuredContent` are exposed only for a negotiated,
SDK-supported protocol version `2026-07-28` or later. Unknown versions are
treated as legacy, including unsupported future dates; older, absent, and
Expand All @@ -58,4 +66,7 @@ request-scoped server.
If a handler intentionally returns non-JSON text or content blocks, set
`PreserveHandlerContent` in `TypedSchemaOptions`, or call
`inventory.PreserveToolHandlerContent(ctx)` from the handler middleware for
request-dependent output such as CSV.
request-dependent output such as CSV. This is for intentional non-DTO responses
such as resources, errors, or CSV; ordinary declared structured success must
retain shared DTO serialization, with modern JSON text equal to
`structuredContent`, even when legacy handler text was a plain mutation message.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/microcosm-cc/bluemonday v1.0.27
github.com/modelcontextprotocol/go-sdk v1.8.0
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021
github.com/segmentio/encoding v0.5.4
github.com/shurcooL/githubv4 v0.0.0-20260209031235-2402fdf4a9ed
github.com/shurcooL/graphql v0.0.0-20240915155400-7ee5256398cf
github.com/spf13/cobra v1.10.2
Expand All @@ -32,7 +33,6 @@ require (
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/sagikazarmark/locafero v0.11.0 // indirect
github.com/segmentio/asm v1.1.3 // indirect
github.com/segmentio/encoding v0.5.4 // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
Expand Down
Loading
Loading