create_issue
Facilitate issue creation in AtomGit repositories by specifying owner, repo, title, body, and optional fields like assignees, milestone, and labels for effective project management.
Instructions
Create a new issue in a AtomGit repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignees | No | ||
| body | Yes | Issue content (in Markdown format) | |
| labels | No | ||
| milestone | No | ||
| owner | Yes | Repository owner, typically referred to as 'username (owner)'. Case-insensitive. | |
| repo | Yes | Repository name. Case-insensitive. | |
| title | Yes | Issue title |
Implementation Reference
- operations/issues.ts:77-89 (handler)Core handler function that executes the HTTP POST request to the AtomGit API to create a new issue.export async function createIssue( owner: string, repo: string, options: z.infer<typeof CreateIssueOptionsSchema> ) { return atomGitRequest( `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues`, { method: "POST", body: options, }, ); }
- index.ts:257-292 (handler)MCP CallToolRequest handler case for 'create_issue': validates input with schema, delegates to issues.createIssue, handles errors and returns result.case "create_issue": { const args = issues.CreateIssueSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; try { console.error(`[DEBUG] Attempting to create issue in ${owner}/${repo}`); console.error(`[DEBUG] Issue options:`, JSON.stringify(options, null, 2)); const issue = await issues.createIssue(owner, repo, options); console.error(`[DEBUG] Issue created successfully`); return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], }; } catch (err) { // Type guard for Error objects const error = err instanceof Error ? err : new Error(String(err)); console.error(`[ERROR] Failed to create issue:`, error); if (error instanceof AtomGitResourceNotFoundError) { throw new Error( `Repository '${owner}/${repo}' not found. Please verify:\n` + `1. The repository exists\n` + `2. You have correct access permissions\n` + `3. The owner and repository names are spelled correctly` ); } // Safely access error properties throw new Error( `Failed to create issue: ${error.message}${error.stack ? `\nStack: ${error.stack}` : '' }` ); } }
- index.ts:121-125 (registration)Tool registration in the MCP server's ListTools response, including name, description, and input schema reference.{ name: "create_issue", description: "Create a new issue in a AtomGit repository", inputSchema: zodToJsonSchema(issues.CreateIssueSchema), },
- operations/issues.ts:4-16 (schema)Zod schemas defining the input structure for create_issue tool: CreateIssueSchema and CreateIssueOptionsSchema.export const CreateIssueOptionsSchema = z.object({ title: z.string().describe("Issue title"), body: z.string().describe("Issue content (in Markdown format)"), assignees: z.array(z.string()).optional(), milestone: z.number().optional(), labels: z.array(z.string()).optional(), }); export const CreateIssueSchema = z.object({ owner: z.string().describe("Repository owner, typically referred to as 'username (owner)'. Case-insensitive."), repo: z.string().describe("Repository name. Case-insensitive."), ...CreateIssueOptionsSchema.shape, });