create-issue
Create GitHub Enterprise issues directly with detailed specifications, including title, labels, assignees, and milestones, through the GitHub Enterprise MCP Server integration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignees | No | Assignee list | |
| body | No | Issue content | |
| labels | No | Label list | |
| milestone | No | Milestone ID | |
| owner | Yes | Repository owner (user or organization) | |
| repo | Yes | Repository name | |
| title | Yes | Issue title |
Implementation Reference
- server/index.ts:1589-1683 (handler)MCP tool registration, input schema (Zod), and handler function for 'create-issue'. Validates parameters, calls underlying createIssue API, formats response.server.tool( "create-issue", { owner: z.string().describe(i18n.t('issues', 'param_owner')), repo: z.string().describe(i18n.t('issues', 'param_repo')), title: z.string().describe(i18n.t('issues', 'param_title')), body: z.string().optional().describe(i18n.t('issues', 'param_body')), labels: z.array(z.string()).optional().describe(i18n.t('issues', 'param_labels')), assignees: z.array(z.string()).optional().describe(i18n.t('issues', 'param_assignees')), milestone: z.number().optional().describe(i18n.t('issues', 'param_milestone')) }, async ({ owner, repo, title, body, labels, assignees, milestone }) => { try { // Parameter validation if (!owner || typeof owner !== 'string' || owner.trim() === '') { return { content: [ { type: "text", text: i18n.t('common', 'error_required', { field: i18n.t('issues', 'param_owner') }) } ], isError: true }; } if (!repo || typeof repo !== 'string' || repo.trim() === '') { return { content: [ { type: "text", text: i18n.t('common', 'error_required', { field: i18n.t('issues', 'param_repo') }) } ], isError: true }; } if (!title || typeof title !== 'string' || title.trim() === '') { return { content: [ { type: "text", text: i18n.t('common', 'error_required', { field: i18n.t('issues', 'param_title') }) } ], isError: true }; } const issue = await context.issues.createIssue(context.client, { owner, repo, title, body, labels, assignees, milestone }); // Format created issue info const formattedIssue = { number: issue.number, title: issue.title, body: issue.body, state: issue.state, user: issue.user.login, created_at: issue.created_at, updated_at: issue.updated_at, labels: issue.labels.map((label: any) => label.name), assignees: issue.assignees?.map((assignee: any) => assignee.login) || [] }; return { content: [ { type: "text", text: i18n.t('issues', 'issue_create_success', { number: issue.number, title: issue.title }) + `\n\n${JSON.stringify(formattedIssue, null, 2)}` } ] }; } catch (error: any) { console.error(i18n.t('common', 'error_generic', { message: error.message })); return { content: [ { type: "text", text: i18n.t('common', 'error_generic', { message: error.message }) } ], isError: true }; } } );
- api/issues/issues.ts:51-57 (helper)Helper function that performs the actual GitHub API POST request to create an issue.export async function createIssue( client: GitHubClient, params: CreateIssueParams ): Promise<Issue> { const { owner, repo, ...data } = params; return client.post<Issue>(`/repos/${owner}/${repo}/issues`, data); }
- api/issues/types.ts:25-33 (schema)TypeScript interface defining the parameters for creating an issue, matching the MCP tool schema.export interface CreateIssueParams { owner: string; repo: string; title: string; body?: string; assignees?: string[]; labels?: string[]; milestone?: number; }