Skip to main content
Glama

add_issue_comment

Add comments to GitHub issues to provide updates, answer questions, or track progress. Specify repository owner, repository name, issue number, and comment content.

Instructions

Add a comment to an existing issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
repoYes
issue_numberYes
bodyYes

Implementation Reference

  • The core handler function that executes the tool by posting a comment to the specified GitHub issue using the GitHub REST API.
    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 for the tool, including the public schema used in registration and the internal one with github_pat.
    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 in the MCP server's list of tools, specifying name, description, and input schema.
    { name: "add_issue_comment", description: "Add a comment to an existing issue", inputSchema: zodToJsonSchema(issues.IssueCommentSchema) },
  • src/index.ts:500-507 (registration)
    Dispatch handler in the MCP server's CallToolRequest that parses arguments and calls the issues.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