Skip to main content
Glama

move

Change GitHub pull request status to attention, waiting, shelved, or auto states to manage open source contribution workflow.

Instructions

Move a PR between states: attention (need attention), waiting (waiting on maintainer), shelved (hidden), or auto (reset to computed status).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prUrlYesFull GitHub PR URL
targetYesTarget state for the PR

Implementation Reference

  • The implementation of the `runMove` function, which handles the logic for transitioning a PR between states (attention, waiting, shelved, or 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}`);
        }
      }
    }
  • The `MoveOutput` interface defining the structure of the data returned by the move operation.
    export interface MoveOutput {
      url: string;
      target: MoveTarget;
      /** Human-readable description of what happened. */
      description: string;
    }
  • The MCP tool registration for the 'move' command, which binds the 'move' tool to the `runMove` handler and defines its Zod input schema.
    // 20. move — Move a PR between states
    server.registerTool(
      'move',
      {
        description:
          'Move a PR between states: attention (need attention), waiting (waiting on maintainer), shelved (hidden), or auto (reset to computed status).',
        inputSchema: {
          prUrl: z.string().describe('Full GitHub PR URL'),
          target: z.enum(['attention', 'waiting', 'shelved', 'auto']).describe('Target state for the PR'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool(runMove),
    );

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