create_issue
Create a new issue in an AtomGit repository to report bugs, request features, or track tasks for open source collaboration.
Instructions
Create a new issue in a AtomGit repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner, typically referred to as 'username (owner)'. Case-insensitive. | |
| repo | Yes | Repository name. Case-insensitive. | |
| title | Yes | Issue title | |
| body | Yes | Issue content (in Markdown format) | |
| assignees | No | ||
| milestone | No | ||
| labels | No |
Implementation Reference
- operations/issues.ts:77-89 (handler)Core handler function that executes the tool logic by making a POST request to the AtomGit API to create an 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 for 'create_issue' that validates input, calls the core createIssue function, handles errors, and returns the formatted response.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}` : '' }` ); } }
- operations/issues.ts:12-16 (schema)Zod schema defining the input structure for the create_issue tool, used for validation and JSON schema conversion.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, });
- operations/issues.ts:4-10 (schema)Zod subschema for issue creation options, composed into the main CreateIssueSchema.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(), });
- index.ts:121-125 (registration)Registration of the 'create_issue' tool in the list returned by ListToolsRequest, including name, description, and input schema.{ name: "create_issue", description: "Create a new issue in a AtomGit repository", inputSchema: zodToJsonSchema(issues.CreateIssueSchema), },