unshelve
Reactivate a shelved GitHub pull request for continued monitoring and management within the OSS contribution workflow.
Instructions
Unshelve a previously shelved PR, returning it to active monitoring.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prUrl | Yes | Full GitHub PR URL to unshelve |
Implementation Reference
- packages/core/src/commands/move.ts:30-82 (handler)The 'runMove' function handles moving PRs between states, including 'shelved' and 'auto' (which involves unshelving). The 'unshelve' MCP tool calls 'runMove' with the target set to 'auto'.
export async function runMove(options: { prUrl: string; target: string }): Promise<MoveOutput> { validateUrl(options.prUrl); validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR'); const target = options.target as MoveTarget; if (!VALID_TARGETS.includes(target)) { throw new Error(`Invalid target "${options.target}". Must be one of: ${VALID_TARGETS.join(', ')}`); } const stateManager = getStateManager(); switch (target) { case 'attention': case 'waiting': { const status = target === 'attention' ? 'needs_addressing' : 'waiting_on_maintainer'; const label = target === 'attention' ? 'Need Attention' : 'Waiting on Maintainer'; // Use current time — the CLI doesn't have cached PR data. The override // will auto-clear on the next daily run if the PR has new activity after this. const lastActivityAt = new Date().toISOString(); stateManager.batch(() => { stateManager.setStatusOverride(options.prUrl, status, lastActivityAt); stateManager.unshelvePR(options.prUrl); }); return { url: options.prUrl, target, description: `Moved to ${label}` }; } case 'shelved': { stateManager.batch(() => { stateManager.shelvePR(options.prUrl); stateManager.clearStatusOverride(options.prUrl); }); return { url: options.prUrl, target, description: 'Shelved — excluded from capacity and actionable items', }; } case 'auto': { stateManager.batch(() => { stateManager.clearStatusOverride(options.prUrl); stateManager.unshelvePR(options.prUrl); }); return { url: options.prUrl, target, description: 'Reset to computed status', }; } default: { const _exhaustive: never = target; throw new Error(`Unhandled move target: ${_exhaustive}`); } } } - packages/mcp-server/src/tools.ts:297-308 (registration)Registration of the 'unshelve' MCP tool in the MCP server. It uses 'runMove' with target 'auto' as its handler.
// 17. unshelve — Unshelve a PR server.registerTool( 'unshelve', { description: 'Unshelve a previously shelved PR, returning it to active monitoring.', inputSchema: { prUrl: z.string().describe('Full GitHub PR URL to unshelve'), }, annotations: { readOnlyHint: false, destructiveHint: false }, }, wrapTool((args: { prUrl: string }) => runMove({ prUrl: args.prUrl, target: 'auto' })), );