Set pull request draft state at exact head
gh_set_pr_draft_stateTransition a pull request between draft and ready-for-review states, verifying the current head SHA and draft status to avoid unintended modifications.
Instructions
Destructive write: transition exactly one pull request between draft and ready-for-review only when its current head SHA and draft state match the supplied preconditions. The operation changes no unrelated pull-request metadata, is attempted once, and authoritative readback verifies both unchanged head identity and the requested draft state.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"owner": "<owner>",
"repo": "<repo>",
"number": "<number>",
"expected_head_sha": "<expected_head_sha>",
"expected_is_draft": "<expected_is_draft>",
"new_is_draft": "<new_is_draft>"
},
"name": "gh_set_pr_draft_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | GitHub repository name without the owner prefix. | |
| owner | Yes | GitHub repository owner or organization login. | |
| number | Yes | Pull request number to transition. | |
| new_is_draft | Yes | Requested draft state after mutation. | |
| expected_head_sha | Yes | Exact current pull-request head SHA required before mutation. | |
| expected_is_draft | Yes | Exact current draft state required before mutation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| number | Yes | ||
| warning | No | ||
| request_id | No | ||
| write_completed | Yes | ||
| current_head_sha | No | ||
| current_is_draft | No | ||
| previous_head_sha | Yes | ||
| previous_is_draft | Yes | ||
| readback_completed | Yes | ||
| precondition_checked | Yes | ||
| state_matches_requested | Yes |