Skip to main content
Glama

create_issue

Create new issues in GitLab projects to track bugs, tasks, or feature requests with titles, descriptions, assignees, labels, and milestones.

Instructions

Create a new issue in a GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or URL-encoded path
titleYesIssue title
descriptionNoIssue description
assignee_idsNoArray of user IDs to assign
labelsNoArray of label names
milestone_idNoMilestone ID to assign

Implementation Reference

  • The implementation of the 'createIssue' function, which handles sending the POST request to the GitLab API to create an issue.
    export async function createIssue(projectId: string, options: CreateIssueOptions): Promise<GitLabIssue> {
      if (!projectId?.trim()) {
        throw new Error("Project ID is required");
      }
      if (!options?.title?.trim()) {
        throw new Error("Issue title is required");
      }
    
      const endpoint = `/projects/${encodeProjectId(projectId)}/issues`;
    
      const issue = await gitlabPost<GitLabIssue>(endpoint, {
        title: options.title,
        description: options.description,
        assignee_ids: options.assignee_ids,
        milestone_id: options.milestone_id,
        labels: options.labels?.join(",")
      });
    
      return GitLabIssueSchema.parse(issue);
    }
  • The schema definition for the 'create_issue' tool's input arguments.
    export const CreateIssueSchema = ProjectParamsSchema.extend({
      title: z.string().describe("Issue title"),
      description: z.string().optional().describe("Issue description"),
      assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"),
      labels: z.array(z.string()).optional().describe("Array of label names"),
      milestone_id: z.number().optional().describe("Milestone ID to assign")
    });
    
    export const CreateMergeRequestSchema = ProjectParamsSchema.extend({
  • src/server.ts:89-97 (registration)
    Tool registration for 'create_issue' in the server implementation.
    {
      name: "create_issue",
      description: "Create a new issue in a GitLab project",
      inputSchema: zodToJsonSchema(CreateIssueSchema)
    },
    {
      name: "create_merge_request",
      description: "Create a new merge request in a GitLab project",
      inputSchema: zodToJsonSchema(CreateMergeRequestSchema)

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/TheRealChrisThomas/gitlab-mcp-server'

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