Skip to main content
Glama

claim

Claim GitHub issues by posting intent-to-work comments to manage open source contributions.

Instructions

Claim a GitHub issue by posting a comment expressing intent to work on it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueUrlYesFull GitHub issue URL to claim
messageNoCustom claim message. If omitted, a default message is used.

Implementation Reference

  • The handler function 'runClaim' which posts a claim comment on a GitHub issue and tracks it locally.
    export async function runClaim(options: ClaimOptions): Promise<ClaimOutput> {
      validateUrl(options.issueUrl);
      validateGitHubUrl(options.issueUrl, ISSUE_URL_PATTERN, 'issue');
    
      const token = requireGitHubToken();
    
      // Default claim message or custom
      const message = options.message || "Hi! I'd like to work on this issue. Could you assign it to me?";
    
      validateMessage(message);
    
      // Parse URL
      const parsed = parseGitHubUrl(options.issueUrl);
      if (!parsed || parsed.type !== 'issues') {
        throw new Error('Invalid issue URL format (must be an issue, not a PR)');
      }
    
      const { owner, repo, number } = parsed;
    
      const octokit = getOctokit(token);
    
      const { data: comment } = await octokit.issues.createComment({
        owner,
        repo,
        issue_number: number,
        body: message,
      });
    
      // Add to tracked issues — non-fatal if state save fails (comment already posted)
      try {
        const stateManager = getStateManager();
        stateManager.addIssue({
          id: number,
          url: options.issueUrl,
          repo: `${owner}/${repo}`,
          number,
          title: '(claimed)',
          status: 'claimed',
          labels: [],
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString(),
          vetted: false,
        });
      } catch (error) {
        console.error(
          `Warning: Comment posted on ${options.issueUrl} but failed to save to local state: ${error instanceof Error ? error.message : error}`,
        );
      }
    
      return {
        commentUrl: comment.html_url,
        issueUrl: options.issueUrl,
      };
    }
  • MCP tool registration for 'claim' which uses the 'runClaim' handler.
    // 10. claim — Claim an issue
    server.registerTool(
      'claim',
      {
        description: 'Claim a GitHub issue by posting a comment expressing intent to work on it.',
        inputSchema: {
          issueUrl: z.string().describe('Full GitHub issue URL to claim'),
          message: z.string().optional().describe('Custom claim message. If omitted, a default message is used.'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool(runClaim),
    );

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