Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

create_issue

Create a new GitHub issue with title, description, assignees, and labels to track tasks, bugs, or features in your project workflow.

Instructions

Create a new GitHub issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionYes
milestoneIdNo
assigneesYes
labelsYes
priorityNo
typeNo

Implementation Reference

  • Core handler that executes the GitHub GraphQL mutation to create an issue with title, body (description), assignees, labels, and milestone.
    async create(data: CreateIssue): Promise<Issue> {
      const mutation = `
        mutation($input: CreateIssueInput!) {
          createIssue(input: $input) {
            issue {
              id
              number
              title
              body
              state
              createdAt
              updatedAt
              assignees(first: 100) {
                nodes {
                  login
                }
              }
              labels(first: 100) {
                nodes {
                  name
                }
              }
              milestone {
                id
              }
            }
          }
        }
      `;
    
      const response = await this.graphql<CreateIssueResponse>(mutation, {
        input: {
          repositoryId: this.repo,
          title: data.title,
          body: data.description,
          assigneeIds: data.assignees,
          labelIds: data.labels,
          milestoneId: data.milestoneId,
        },
      });
    
      return this.mapGitHubIssueToIssue(response.createIssue.issue);
    }
  • Service layer handler that processes tool arguments, enriches labels with priority/type, and delegates to GitHubIssueRepository.
    async createIssue(data: {
      title: string;
      description: string;
      milestoneId?: string;
      assignees?: string[];
      labels?: string[];
      priority?: string;
      type?: string;
    }): Promise<Issue> {
      try {
        // Create labels based on priority and type if provided
        const labels = data.labels || [];
        if (data.priority) {
          labels.push(`priority:${data.priority}`);
        }
        if (data.type) {
          labels.push(`type:${data.type}`);
        }
    
        const issueData: CreateIssue = {
          title: data.title,
          description: data.description,
          assignees: data.assignees || [],
          labels,
          milestoneId: data.milestoneId,
        };
    
        return await this.issueRepo.create(issueData);
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • ToolDefinition for 'create_issue' including Zod input schema reference, description, and usage examples.
    export const createIssueTool: ToolDefinition<CreateIssueArgs> = {
      name: "create_issue",
      description: "Create a new GitHub issue",
      schema: createIssueSchema as unknown as ToolSchema<CreateIssueArgs>,
      examples: [
        {
          name: "Create bug issue",
          description: "Create a bug issue with high priority",
          args: {
            title: "Fix authentication bug",
            description: "Users cannot log in with social media accounts",
            priority: "high",
            type: "bug",
            assignees: ["developer1"],
            labels: ["bug", "authentication"]
          }
        }
      ]
    };
  • Registers the createIssueTool in the central ToolRegistry singleton used by MCP server.
    this.registerTool(createIssueTool);
    this.registerTool(listIssuesTool);
    this.registerTool(getIssueTool);
    this.registerTool(updateIssueTool);
  • Zod schema defining input validation for create_issue tool parameters.
    export const createIssueSchema = z.object({
      title: z.string().min(1, "Issue title is required"),
      description: z.string().min(1, "Issue description is required"),
      milestoneId: z.string().optional(),
      assignees: z.array(z.string()).default([]),
      labels: z.array(z.string()).default([]),
      priority: z.enum(["high", "medium", "low"]).default("medium").optional(),
      type: z.enum(["bug", "feature", "enhancement", "documentation"]).default("feature").optional(),
    });
    
    export type CreateIssueArgs = z.infer<typeof createIssueSchema>;
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/kunwarVivek/mcp-github-project-manager'

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