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
75 changes: 42 additions & 33 deletions docs/feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,53 +150,59 @@ containing `issue_number`, `artifact_number`, and a confirmation message.

Enable `--features=pull_request_artifacts` (or
`GITHUB_FEATURES=pull_request_artifacts`) to expose
`pull_request_artifact_read` (`method: list`) and
`pull_request_artifact_write` (`method: upsert | delete`) in the
`pull_request_artifact_read` (`method: list | get`) and
`pull_request_artifact_write` (`method: upsert | update | delete`) in the
`pull_requests` toolset. This flag is **off by default**, including in Insiders
mode. Read-only mode exposes only the read tool. Both tools reject calls in
lockdown mode.

All operations require `owner`, `repo`, and `pull_number`. The tools resolve
the repository's numeric ID and use the configured authenticated GitHub
client and API base URL. They declare `repo` in OAuth challenge metadata;
the API separately enforces pull request read access for list and artifact
write access for upsert/delete, including repository writeability and storage
availability. No endpoint-specific preview header is added.

Upsert and delete address artifacts by **name**, not artifact number or global
ID. Supply exactly one of `name` (the exact original name) or `name_key` (the
lossless key returned by reads and writes). Returned `name` values are sanitized
for display and must not be used as mutation keys: distinct original names can
have the same display name. Pass `name_key` verbatim to update or delete an
artifact discovered through a read. Keys use unpadded URL-safe Base64 encoding
of the original name and are not authorization tokens.
Upsert requires `body` and optionally accepts `commit_oid`.
The body is sent unchanged, including an empty string; the API validates its
content and constraints. Upsert accepts both creation (201) and replacement
(200) responses. Delete rejects `body` and `commit_oid`.
the API separately enforces pull request read access for list/get and artifact
write access for upsert/update/delete, including repository writeability and
storage availability. No endpoint-specific preview header is added.

Get, update, and delete use the positive PR-scoped `artifact_number` returned
as `number`, not the global ID or sanitized name. Upsert uses exactly one of
`name` (the exact original name) or `name_key` (the lossless key returned by
reads and writes). Returned names are sanitized for display; pass `name_key`
verbatim to upsert an artifact discovered through a read. Keys use unpadded
URL-safe Base64 encoding and are not authorization tokens.

Upsert requires `body` and optionally accepts `type` and `commit_oid`. Type
defaults to `generic` on creation and update; use `embedded_html` on every
upsert of an HTML artifact, whose type cannot be changed. Upsert accepts both
creation (201) and replacement (200) responses. Update requires `body` and
`commit_oid`: supply a full OID or an empty string to clear the association.
Bodies are sent unchanged and the API validates their content and constraints.
Delete accepts neither body nor commit association.
Before deletion, the client must obtain explicit user confirmation of the exact
repository, PR number, and artifact name through form elicitation. Confirmation
repository, PR number, and artifact number through form elicitation. Confirmation
requires MCP protocol `2026-07-28` or later and configured request-state protection.
The protected state binds approval to the target repository ID, PR, and artifact
name and expires after ten minutes. Missing, invalid, expired, declined, or
number and expires after ten minutes. Missing, invalid, expired, declined, or
canceled confirmation prevents deletion, as does a changed repository identity.
Clients without the required protocol or form-elicitation support cannot delete;
list and upsert remain available. This relies on the client to present the
confirmation to the user rather than answer on the model's behalf.
list, get, upsert, and update remain available. This relies on the client to
present the confirmation to the user rather than answer on the model's behalf.
Writes are not automatically retried; API errors, including conflicts,
validation failures, throttling, and storage failures, are returned explicitly.

List includes artifact bodies and accepts `commit_oid`: omit it or use
`current` for the PR's current head, use `all` for every commit, or supply an
explicit commit OID. For a stable commit selection across pages, use an
explicit OID instead of a moving PR head. List returns one requested page
(`page` defaults to 1, `perPage` defaults to 30 and is limited to 100).
`current` for the PR's current head, use `all` for the newest retained version
of each artifact regardless of commit, or supply a full commit OID. Commit
selection falls back to the newest version without a commit association when
there is no match; artifacts with neither are omitted. For a stable commit
selection across pages, use an explicit OID instead of a moving PR head. List
returns one requested page (`page` defaults to 1, `perPage` defaults to 30 and
is limited to 100).
Request `next_page` when present; its value comes from the API's REST Link
header, not the number of returned artifacts.

Upsert returns an `artifact` object. List returns a `list` object containing
`artifacts`, `page`, `perPage`, and optional `next_page`. Delete returns a
`deleted` object containing `pull_number`, display `name`, lossless `name_key`,
Get, upsert, and update return an `artifact` object. List returns a `list`
object containing `artifacts`, `page`, `perPage`, and optional `next_page`. Delete returns a
`deleted` object containing `pull_number`, `artifact_number`,
and a confirmation message.
Artifact IDs are opaque JSON strings or integers and are never mutation
identifiers. Results preserve nullable commit, creator, and timestamp
Expand Down Expand Up @@ -601,7 +607,8 @@ as output formatting) won't appear here.

- **pull_request_artifact_read** - Read pull request artifacts
- **OAuth Challenge Scopes**: `repo`
- `commit_oid`: Commit selection: omitted or current for the current PR head, all for every commit, or an explicit commit OID (string, optional)
- `artifact_number`: Positive PR-scoped artifact number; required for get (integer, optional)
- `commit_oid`: List commit selection: omitted or current for the PR head, all for the newest version regardless of commit, or an explicit commit OID (string, optional)
- `method`: (string, required)
- `owner`: Repository owner (string, required)
- `page`: Page number, starting at 1 (default 1) (integer, optional)
Expand All @@ -611,14 +618,16 @@ as output formatting) won't appear here.

- **pull_request_artifact_write** - Write pull request artifacts
- **OAuth Challenge Scopes**: `repo`
- `body`: Required for upsert: artifact content; an empty string is sent unchanged. Not supported for delete (string, optional)
- `commit_oid`: Optional commit OID for upsert only; omission preserves the API default (string, optional)
- `artifact_number`: Positive PR-scoped artifact number; required for update and delete (integer, optional)
- `body`: Required for upsert and update: artifact content (string, optional)
- `commit_oid`: Optional for upsert; required for update, with an empty string clearing the association (string, optional)
- `method`: (string, required)
- `name`: Exact artifact name for creation or addressing; mutually exclusive with name_key. Do not copy sanitized display names from read results (string, optional)
- `name_key`: Lossless addressing key returned by artifact reads or writes; mutually exclusive with name. Pass verbatim without decoding (string, optional)
- `name`: Exact artifact name for upsert; mutually exclusive with name_key. Do not copy sanitized display names from read results (string, optional)
- `name_key`: Lossless name key returned by artifact reads or writes for upsert; mutually exclusive with name (string, optional)
- `owner`: Repository owner (string, required)
- `pull_number`: Positive pull request number (integer, required)
- `repo`: Repository name (string, required)
- `type`: Artifact type for upsert: generic or embedded_html; omission defaults to generic (string, optional)

### `agent_automations`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"readOnlyHint": true,
"title": "Read pull request artifacts"
},
"description": "List GitHub pull request artifact versions including their bodies. Names are sanitized for display; use the returned name_key, not name, for subsequent writes. commit_oid defaults to the current PR head; use all or an explicit commit OID to change the selection. Returns one page; request next_page when present. Repository access and the repository's pull_request_artifacts_api rollout are enforced by GitHub. Unavailable in lockdown mode.",
"description": "List GitHub pull request artifact versions or get the current version by PR-scoped artifact_number, including bodies. Names are sanitized for display; use number for get, update, and delete, or name_key for upsert. List commit_oid defaults to the current PR head; use all or an explicit commit OID to change the selection. List returns one page; request next_page when present. Repository access and the repository's pull_request_artifacts_api rollout are enforced by GitHub. Unavailable in lockdown mode.",
"icons": [
{
"mimeType": "image/png",
Expand All @@ -21,13 +21,19 @@
"inputSchema": {
"additionalProperties": false,
"properties": {
"artifact_number": {
"description": "Positive PR-scoped artifact number; required for get",
"minimum": 1,
"type": "integer"
},
"commit_oid": {
"description": "Commit selection: omitted or current for the current PR head, all for every commit, or an explicit commit OID",
"description": "List commit selection: omitted or current for the PR head, all for the newest version regardless of commit, or an explicit commit OID",
"type": "string"
},
"method": {
"enum": [
"list"
"list",
"get"
],
"type": "string"
},
Expand Down Expand Up @@ -72,6 +78,90 @@
"outputSchema": {
"additionalProperties": false,
"properties": {
"artifact": {
"additionalProperties": false,
"properties": {
"body": {
"type": "string"
},
"commit_oid": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"creator": {
"additionalProperties": false,
"properties": {
"id": {
"type": "integer"
},
"login": {
"type": "string"
}
},
"required": [
"login",
"id"
],
"type": [
"null",
"object"
]
},
"id": {
"description": "Opaque global artifact ID; use number to address an artifact",
"type": [
"string",
"integer"
]
},
"name": {
"description": "Sanitized display name",
"type": "string"
},
"name_key": {
"description": "Lossless base64url-encoded artifact name; pass verbatim as name_key for upsert",
"type": "string"
},
"number": {
"description": "Artifact number within the pull request",
"type": "integer"
},
"type": {
"description": "Artifact type, such as generic or embedded_html",
"type": "string"
},
"updated_at": {
"type": [
"null",
"string"
]
}
},
"required": [
"id",
"number",
"name",
"name_key",
"type",
"body",
"commit_oid",
"creator",
"created_at",
"updated_at"
],
"type": [
"null",
"object"
]
},
"list": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -114,23 +204,28 @@
]
},
"id": {
"description": "Opaque artifact ID; mutations use name or name_key instead",
"description": "Opaque global artifact ID; use number to address an artifact",
"type": [
"string",
"integer"
]
},
"name": {
"description": "Sanitized display name; use name_key when addressing this artifact",
"description": "Sanitized display name",
"type": "string"
},
"name_key": {
"description": "Lossless base64url-encoded artifact name; pass verbatim as name_key to write operations",
"description": "Lossless base64url-encoded artifact name; pass verbatim as name_key for upsert",
"type": "string"
},
"number": {
"description": "Artifact number within the pull request",
"type": "integer"
},
"type": {
"description": "Artifact type, such as generic or embedded_html",
"type": "string"
},
"updated_at": {
"type": [
"null",
Expand All @@ -143,6 +238,7 @@
"number",
"name",
"name_key",
"type",
"body",
"commit_oid",
"creator",
Expand Down Expand Up @@ -178,9 +274,6 @@
]
}
},
"required": [
"list"
],
"type": [
"null",
"object"
Expand Down
Loading