Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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