create_issue_comment
Add a comment to a specific issue in an AtomGit repository. Specify repository owner, repository name, issue number, and comment content in Markdown format.
Instructions
Create an issue comment in a AtomGit repository issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Issue comment content (in Markdown format) | |
| issue_number | Yes | Issue number | |
| owner | Yes | Repository owner, typically referred to as 'username (owner)'. Case-insensitive. | |
| repo | Yes | Repository name. Case-insensitive. |
Implementation Reference
- operations/issues.ts:232-247 (handler)Core handler function that performs the HTTP POST request to the AtomGit API to create an issue comment.export async function createIssueComment( owner: string, repo: string, issue_number: number, body: string ) { return atomGitRequest( `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${encodeURIComponent(issue_number)}/comments`, { method: "POST", body: { body }, } ); }
- operations/issues.ts:26-31 (schema)Zod schema defining the input parameters (owner, repo, issue_number, body) for the create_issue_comment tool.export const CreateIssueCommentSchema = z.object({ owner: z.string().describe("Repository owner, typically referred to as 'username (owner)'. Case-insensitive."), repo: z.string().describe("Repository name. Case-insensitive."), issue_number: z.number().describe("Issue number"), body: z.string().describe("Issue comment content (in Markdown format)"), });
- index.ts:127-131 (registration)Registration of the 'create_issue_comment' tool in the MCP server's listTools response, including name, description, and input schema reference.name: "create_issue_comment", description: "Create an issue comment in a AtomGit repository issue", inputSchema: zodToJsonSchema(issues.CreateIssueCommentSchema), },
- index.ts:294-327 (handler)MCP callTool dispatch handler that parses arguments, calls the core createIssueComment function, handles errors, and formats the response.case "create_issue_comment": { const args = issues.CreateIssueCommentSchema.parse(request.params.arguments); const { owner, repo, issue_number, body } = args; try { console.error(`[DEBUG] Attempting to create issue comment in ${owner}/${repo}`); const issue = await issues.createIssueComment(owner, repo, issue_number, body); 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 comment: ${error.message}${error.stack ? `\nStack: ${error.stack}` : '' }` ); } }