Expose team_reviewers in add_reviewer MCP tool schema#29229
Conversation
… types - Add `team_reviewers` property to `add_reviewer` inputSchema in both `actions/setup/js/safe_outputs_tools.json` and `pkg/workflow/js/safe_outputs_tools.json` - Replace `required: ['reviewers']` with `anyOf` requiring at least one of `reviewers` or `team_reviewers` in `actions/setup/js/safe_outputs_tools.json` - Update tool description to mention team reviewer support - Add `team_reviewers` optional field to `AddReviewerItem` TypeScript interface and make `reviewers` optional (consistent with anyOf constraint) - Update `pull_request_number` description in actions/setup/js to be more informative The Go handler config generation and runtime JavaScript handler already supported team_reviewers - this change exposes the feature through the MCP tool schema so AI agents can use it. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a993684c-b06c-43a0-bdc0-0483e73e2564 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
team_reviewers in add_reviewer MCP tool schema
|
Hey One thing to address before this is ready:
If you'd like a hand adding coverage, assign this prompt to your coding agent:
|
There was a problem hiding this comment.
Pull request overview
Exposes team_reviewers in the add_reviewer MCP tool schema so agents can add team reviewers explicitly (instead of incorrectly passing team slugs via reviewers).
Changes:
- Updated the
add_reviewerJSON schema to acceptteam_reviewersand to require at least one ofreviewers/team_reviewersviaanyOf. - Updated the tool description to mention team reviewer support.
- Updated TypeScript typings to add
team_reviewers?: string[]and makereviewersoptional.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_outputs_tools.json | Adds team_reviewers, replaces required with anyOf, and updates parameter/tool descriptions. |
| pkg/workflow/js/safe_outputs_tools.json | Updates the add_reviewer tool description to mention team reviewers. |
| actions/setup/js/types/safe-outputs.d.ts | Adds team_reviewers typing and makes reviewers optional to align with schema intent. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/3 changed files
- Comments generated: 1
| "inputSchema": { | ||
| "type": "object", | ||
| "required": ["reviewers"], | ||
| "anyOf": [{ "required": ["reviewers"] }, { "required": ["team_reviewers"] }], | ||
| "properties": { |
There was a problem hiding this comment.
The schema now uses anyOf to require at least one of reviewers or team_reviewers, but the MCP server-side argument validation only checks inputSchema.required (see actions/setup/js/mcp_scripts_validation.cjs:15-27). With no required array, calls that omit both fields won’t be rejected early and won’t get an enhanced “missing args” error. Consider either extending validateRequiredFields (and enhanced error generation) to understand this anyOf pattern, or keeping a required-based constraint that the server can actually enforce.
See below for a potential fix:
"description": "Add reviewers (users or teams) to a GitHub pull request. Reviewers receive notifications and can approve or request changes. Use 'copilot' as a reviewer name to request the Copilot PR review bot. Provide `reviewers` for user reviewers; include `team_reviewers` for team reviewers. To request only team reviewers, pass `reviewers: []` so current server-side required-argument validation succeeds.",
"inputSchema": {
"type": "object",
"required": ["reviewers"],
"properties": {
"reviewers": {
"type": "array",
"items": {
"type": "string"
},
"description": "GitHub usernames to add as reviewers (e.g., ['octocat', 'copilot']). Users must have access to the repository. This field is required by current server-side validation; if you are only adding team reviewers, pass an empty array here."
},
"team_reviewers": {
"type": "array",
"items": {
"type": "string"
},
"description": "GitHub team slugs to add as team reviewers (e.g., ['platform-team', 'security-reviewers']). Teams must have access to the repository. If you only want team reviewers, also pass `reviewers: []`."
The
add_reviewertool handler and Go config generation already supported team reviewers end-to-end, but the MCP tool schema only exposedreviewers(user logins). Agents passing team slugs throughreviewerswould get a silent 201 with no team assigned.Changes
actions/setup/js/safe_outputs_tools.json— addsteam_reviewersarray property; replacesrequired: ["reviewers"]withanyOfrequiring at least one ofreviewersorteam_reviewers; alignspull_request_numberdescription with the more informative version already in the embedded schemapkg/workflow/js/safe_outputs_tools.json— updates tool description to mention team reviewer support (schema was already correct in this file)actions/setup/js/types/safe-outputs.d.ts— addsteam_reviewers?: string[]toAddReviewerItem; makesreviewersoptional to match theanyOfconstraintExample
{"type":"add_reviewer","team_reviewers":["platform-team","security-reviewers"]} {"type":"add_reviewer","reviewers":["octocat"],"team_reviewers":["platform-team"]}Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw on_test.go(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw go lidation_test.go/home/REDACTED/work/gh-aw/gh-aw/.github/workflows x_amd64/vet vali�� *.json' '!../../remote.origin.url validation_test.go 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ./../pkg/workflo-errorsas --local git http.https://gitbash(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv se 7677065/b024/vet.cfg ock.yml(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 7677065/b075/_pkremote.origin.url pkg/workflow/compiled_lock_files_test.go yml pkg/workflow/cominfocmp /testdeps pkg/workflow/comxterm-color ache/go/1.25.8/x64/pkg/tool/linushow(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ./../pkg/workflo-errorsas --local k/gh-aw/gh-aw/.g-nilfunc(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv se 7677065/b021/vetowner=github .cfg(http block)https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv get --local $name) { hasDiscussionsEnabled } } core.hooksPath(http block)/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv get --local x_amd64/vet core.hooksPath(http block)https://api.github.com/repos/github/gh-aw/usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch npx prettier --wremote.origin.url(http block)If you need me to access, download, or install something from one of these locations, you can either: