Skip to main content
Glama

create_issue

Create and manage GitHub repository issues by specifying an owner, repository, title, description, assignees, milestones, and labels directly through the server.

Instructions

Create a new issue in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNo
bodyNo
labelsNo
milestoneNo
ownerYes
repoYes
titleYes

Implementation Reference

  • Core handler function that executes the GitHub API POST request to create a new issue in the repository.
    export async function createIssue(
      owner: string,
      repo: string,
      options: z.infer<typeof CreateIssueOptionsSchema>
    ) {
      return githubRequest(
        `https://api.github.com/repos/${owner}/${repo}/issues`,
        {
          method: "POST",
          body: options,
        }
      );
    }
  • MCP CallTool handler case that parses input schema, extracts parameters, calls the core createIssue function, and formats the response.
    case "create_issue": {
      const args = issues.CreateIssueSchema.parse(request.params.arguments);
      const { owner, repo, ...options } = args;
      const issue = await issues.createIssue(owner, repo, options);
      return {
        content: [{ type: "text", text: JSON.stringify(issue, null, 2) }],
      };
    }
  • index.ts:96-99 (registration)
    Tool registration in the ListToolsRequestHandler response array, defining name, description, and input JSON schema.
      name: "create_issue",
      description: "Create a new issue in a GitHub repository",
      inputSchema: zodToJsonSchema(issues.CreateIssueSchema),
    },
  • Composite Zod schema for the full create_issue input, including owner, repo, and options.
    export const CreateIssueSchema = z.object({
      owner: z.string(),
      repo: z.string(),
      ...CreateIssueOptionsSchema.shape,
    });
  • Zod schema defining the options for creating an issue (title, body, assignees, etc.). Used in CreateIssueSchema.
    export const CreateIssueOptionsSchema = z.object({
      title: z.string(),
      body: z.string().optional(),
      assignees: z.array(z.string()).optional(),
      milestone: z.number().optional(),
      labels: z.array(z.string()).optional(),
    });

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/tuanle96/mcp-github'

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