Skip to main content
Glama

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
NameRequiredDescriptionDefault
prUrlYesFull GitHub PR URL to unshelve

Implementation Reference

  • 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}`);
        }
      }
    }
  • 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' })),
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description aligns with annotations (readOnlyHint: false confirms state change; destructiveHint: false confirms no deletion). Adds valuable context that the operation returns the PR to 'active monitoring' and requires the PR to have been previously shelved.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with zero waste. Front-loaded action verb, eligibility constraint ('previously shelved'), and outcome ('active monitoring') all efficiently packed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complete for this low-complexity tool (1 param, binary state change). Annotations cover safety profile; description adequately explains business logic and outcome without requiring output schema details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with 'prUrl' fully documented. Description does not mention the parameter explicitly, but with complete schema documentation, baseline 3 is appropriate as no additional compensation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Unshelve' with clear resource 'previously shelved PR' and outcome 'returning it to active monitoring.' Implicitly distinguishes from sibling 'shelve' (opposite action) and 'track' (which would be for new PRs vs. reactivating shelved ones).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage constraint with 'previously shelved PR' indicating eligibility, but lacks explicit when-not-to-use guidance or named alternatives (e.g., does not state 'for new PRs use track instead').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/costajohnt/oss-autopilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server