Skip to main content
Glama

add_issue_comment

Add detailed comments to GitHub issues using owner, repo, issue number, and body inputs. Facilitates issue tracking and collaboration within projects.

Instructions

Add a comment to an existing issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
issue_numberYes
ownerYes
repoYes

Implementation Reference

  • Core handler function that executes the GitHub API POST request to add a comment to an issue.
    export async function addIssueComment( github_pat: string, owner: string, repo: string, issue_number: number, body: string ) { return githubRequest(github_pat, `https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}/comments`, { method: "POST", body: { body }, }); }
  • Zod schemas defining the input parameters (IssueCommentSchema) and extended with PAT (_IssueCommentSchema) for the add_issue_comment tool.
    export const IssueCommentSchema = z.object({ owner: z.string(), repo: z.string(), issue_number: z.number(), body: z.string(), }); export const _IssueCommentSchema = IssueCommentSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • src/index.ts:138-142 (registration)
    Tool registration entry in the listTools response, specifying name, description, and input schema.
    { name: "add_issue_comment", description: "Add a comment to an existing issue", inputSchema: zodToJsonSchema(issues.IssueCommentSchema) },
  • Dispatch handler in the main CallToolRequestSchema that validates arguments and calls the specific addIssueComment function.
    case "add_issue_comment": { const argsWithPat = issues._IssueCommentSchema.parse(params.arguments); const { github_pat, owner, repo, issue_number, body } = argsWithPat; const result = await issues.addIssueComment(github_pat, owner, repo, issue_number, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }

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/MissionSquad/mcp-github'

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