Skip to main content
Glama

shelve

Temporarily hide a GitHub pull request from daily checks and status reports while keeping it tracked.

Instructions

Shelve a PR to temporarily hide it from daily checks and status reports without untracking it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prUrlYesFull GitHub PR URL to shelve

Implementation Reference

  • MCP tool registration for 'shelve' — maps to runMove with target='shelved'
    // 16. shelve — Shelve a PR
    server.registerTool(
      'shelve',
      {
        description: 'Shelve a PR to temporarily hide it from daily checks and status reports without untracking it.',
        inputSchema: {
          prUrl: githubPrUrlSchema.describe('Full GitHub PR URL to shelve'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool((args: { prUrl: string }) => runMove({ prUrl: args.prUrl, target: 'shelved' })),
    );
  • Actual handler that the 'shelve' tool delegates to — runMove() with target='shelved' calls stateManager.shelvePR() and clearStatusOverride()
    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 ValidationError(`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);
          });
          await maybeCheckpoint(stateManager, MODULE);
          return { url: options.prUrl, target, description: `Moved to ${label}` };
        }
        case 'shelved': {
          stateManager.batch(() => {
            stateManager.shelvePR(options.prUrl);
            stateManager.clearStatusOverride(options.prUrl);
          });
          await maybeCheckpoint(stateManager, MODULE);
          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);
          });
          await maybeCheckpoint(stateManager, MODULE);
          return {
            url: options.prUrl,
            target,
            description: 'Reset to computed status',
          };
        }
        default: {
          const _exhaustive: never = target;
          throw new Error(`Unhandled move target: ${_exhaustive}`);
        }
      }
    }
  • Input schema definition for the 'shelve' tool — validates GitHub PR URL format
    const githubPrUrlSchema = z
      .string()
      .url()
      .regex(GITHUB_PR_URL_REGEX, 'Must be a GitHub PR URL like https://github.com/owner/repo/pull/123');
    const githubIssueOrPrUrlSchema = z
  • StateManager.shelvePR() — the lowest-level helper that adds a PR URL to the shelvedPRUrls array and triggers autosave
    shelvePR(url: string): boolean {
      if (!this.state.config.shelvedPRUrls) {
        this.state.config.shelvedPRUrls = [];
      }
      if (this.state.config.shelvedPRUrls.includes(url)) {
        return false;
      }
      this.state.config.shelvedPRUrls.push(url);
      this.autoSave();
      return true;
    }
  • runUnshelve() — the direct companion function to undo shelving (also available via runMove with target='auto')
    export async function runUnshelve(options: { prUrl: string }): Promise<UnshelveOutput> {
      validateUrl(options.prUrl);
      validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR');
    
      const stateManager = getStateManager();
      let removed = false;
      stateManager.batch(() => {
        removed = stateManager.unshelvePR(options.prUrl);
        stateManager.clearStatusOverride(options.prUrl);
      });
      await maybeCheckpoint(stateManager, MODULE);
    
      return { unshelved: removed, url: options.prUrl };
    }
Behavior4/5

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

Annotations indicate non-read-only and non-destructive. The description adds behavioral clarity by explaining the temporary hiding effect and that tracking is preserved, providing context beyond annotations.

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?

The description is a single, front-loaded sentence with no unnecessary words. Every word earns its place.

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?

The tool is simple with one parameter and no output schema. The description covers the core behavior, though it could hint at reversibility via 'unshelve' for completeness. Still adequate.

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 description coverage is 100% for the single parameter 'prUrl'. The description does not add additional parameter meaning beyond what the schema already provides, so it meets the baseline.

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?

The description uses a specific verb 'Shelve' and resource 'PR', clearly stating the action: temporarily hide from daily checks and status reports without untracking. This distinguishes it from siblings like 'untrack' and 'unshelve'.

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?

The description implies usage for temporarily hiding a PR while keeping it tracked, but it does not explicitly state when to use versus alternatives like 'untrack' or 'dismiss'. No when-not scenarios are mentioned.

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