Skip to main content
Glama

add_issues_to_sprint

Add GitHub issues to an existing sprint for project management and tracking.

Instructions

Add issues to an existing sprint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sprintIdYes
issueIdsYes

Implementation Reference

  • Main handler function for the 'add_issues_to_sprint' tool. Loops through issueIds and calls sprintRepo.addIssue to add each issue to the sprint, returns success status and count.
    async addIssuesToSprint(data: {
      sprintId: string;
      issueIds: string[];
    }): Promise<{ success: boolean; addedIssues: number; message: string }> {
      try {
        let addedCount = 0;
        const issues = [];
    
        // Add each issue to the sprint
        for (const issueId of data.issueIds) {
          try {
            await this.sprintRepo.addIssue(data.sprintId, issueId);
            addedCount++;
            issues.push(issueId);
          } catch (error) {
            process.stderr.write(`Failed to add issue ${issueId} to sprint: ${error}`);
          }
        }
    
        return {
          success: addedCount > 0,
          addedIssues: addedCount,
          message: `Added ${addedCount} issue(s) to sprint ${data.sprintId}`
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod input schema and TypeScript type definition for the add_issues_to_sprint tool arguments.
    // Schema for add_issues_to_sprint tool
    export const addIssuesToSprintSchema = z.object({
      sprintId: z.string().min(1, "Sprint ID is required"),
      issueIds: z.array(z.string()).min(1, "At least one issue ID is required"),
    });
    
    export type AddIssuesToSprintArgs = z.infer<typeof addIssuesToSprintSchema>;
  • Registration of the addIssuesToSprintTool in the central ToolRegistry during built-in tools initialization.
    this.registerTool(updateSprintTool);
    this.registerTool(addIssuesToSprintTool);
    this.registerTool(removeIssuesFromSprintTool);
  • ToolDefinition export including name, description, schema reference, and usage examples for add_issues_to_sprint.
    export const addIssuesToSprintTool: ToolDefinition<AddIssuesToSprintArgs> = {
      name: "add_issues_to_sprint",
      description: "Add issues to an existing sprint",
      schema: addIssuesToSprintSchema as unknown as ToolSchema<AddIssuesToSprintArgs>,
      examples: [
        {
          name: "Add issues to sprint",
          description: "Add multiple issues to an existing sprint",
          args: {
            sprintId: "sprint_1",
            issueIds: ["123", "124", "125"]
          }
        }
      ]
    };
  • Low-level helper that performs GraphQL mutation to update project item field value, assigning issues to sprint (iteration field). Called by public addIssue method.
    private async addIssuesToSprint(sprintId: string, issueIds: IssueId[]): Promise<void> {
      const addItemQuery = `
        mutation($input: UpdateProjectV2ItemFieldValueInput!) {
          updateProjectV2ItemFieldValue(input: $input) {
            projectV2Item {
              id
            }
          }
        }
      `;
    
      for (const issueId of issueIds) {
        await this.graphql(addItemQuery, {
          input: {
            projectId: this.config.projectId,
            itemId: `Issue_${issueId}`,
            fieldId: sprintId,
            value: "ITERATION",
          },
        });
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action is 'Add' (implying a write/mutation operation) but doesn't disclose critical traits: whether it requires specific permissions, if it's idempotent (adding duplicate issues), what happens on failure (partial adds), rate limits, or response format. The description doesn't contradict annotations (none exist), but it's insufficient for a mutation tool.

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, direct sentence with zero wasted words—front-loaded and perfectly concise. It efficiently communicates the core action without unnecessary elaboration, making it easy to parse quickly.

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

Completeness2/5

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

Given a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, error handling, parameter semantics, and integration with sibling tools (e.g., 'get_current_sprint'). For a tool that modifies data, this minimal description risks misuse or confusion by the agent.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter details. It doesn't explain what 'sprintId' and 'issueIds' represent (e.g., numeric IDs, strings), their format, sourcing (from 'list_sprints' or 'list_issues'), or constraints (e.g., max issues per call). The description repeats the tool name without enhancing parameter understanding.

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

Purpose4/5

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

The description clearly states the action ('Add') and target ('issues to an existing sprint'), making the purpose immediately understandable. It distinguishes from sibling tools like 'create_sprint' (creates new sprints) and 'remove_issues_from_sprint' (removes issues). However, it doesn't specify what type of 'issues' (e.g., tasks, bugs) or mention the resource context (e.g., project management system).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., sprint must exist, issues must be unassigned), exclusions (e.g., cannot add issues to completed sprints), or related tools like 'create_issue' (to first create issues) or 'plan_sprint' (for broader sprint planning). Usage is implied but not explicitly defined.

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/HarshKumarSharma/MCP'

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