Skip to main content
Glama

create_issue

Create new GitHub issues to track tasks, bugs, or features with assignees, labels, and descriptions for project management.

Instructions

Create a new GitHub issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionYes
milestoneIdNo
assigneesYes
labelsYes
priorityNo
typeNo

Implementation Reference

  • Core handler function that executes the create_issue tool logic: processes args, generates labels from priority/type, creates CreateIssue object, and calls GitHubIssueRepository.create to make the API call.
    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);
      }
    }
  • Zod schema definition for validating input arguments to the create_issue tool, including title, description, milestone, assignees, labels, priority, and type.
    // Schema for create_issue tool
    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>;
  • Registers the createIssueTool (imported from ToolSchemas) in the central ToolRegistry singleton.
    // Register issue tools
    this.registerTool(createIssueTool);
    this.registerTool(listIssuesTool);
    this.registerTool(getIssueTool);
    this.registerTool(updateIssueTool);
  • MCP tool dispatch handler in executeToolHandler switch statement that routes create_issue calls to ProjectManagementService.createIssue.
    case "create_issue":
      return await this.service.createIssue(args);
  • ToolDefinition object for create_issue, including name, description, schema reference, 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"]
          }
        }
      ]
    };

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