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),
    );
Behavior3/5

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

The description aligns with annotations (write operation, non-destructive) and adds the behavioral context that claiming happens via a comment. However, it omits details about idempotency (what happens if already claimed) and doesn't describe the default message content.

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 with the action ('Claim') and resource, followed by the mechanism. Every clause earns its place by distinguishing the tool's specific purpose.

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?

For a simple two-parameter tool with good annotations and no output schema, the description covers the essential behavioral contract. Minor gaps remain regarding edge case handling (e.g., already-claimed issues), but sufficient for invocation.

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?

With 100% schema description coverage, the baseline is appropriately 3. The description mentions 'GitHub issue' and 'comment' which map to the parameters, but doesn't add syntax details or validation rules beyond what the schema already provides.

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 provides a specific verb ('Claim'), resource ('GitHub issue'), and mechanism ('by posting a comment expressing intent to work on it'). It clearly distinguishes this from the generic 'post' sibling tool by specifying the claiming intent.

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?

While the description clearly implies when to use this tool (to claim an issue), it lacks explicit guidance on when NOT to use it versus siblings like 'post', or prerequisites like requiring the user to not already be assigned to the issue.

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