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) }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Add a comment' implies a write/mutation operation, it doesn't specify authentication requirements, rate limits, whether comments are editable/deletable, what happens on success/failure, or any side effects. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a tool with a straightforward purpose, though the brevity comes at the cost of completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It should explain authentication needs, error conditions, return values, and parameter meanings to compensate for the missing structured documentation. The current description leaves too many operational questions unanswered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for all 4 parameters, the description provides no information about what 'owner', 'repo', 'issue_number', or 'body' represent or require. The description mentions 'existing issue' which hints at issue_number but doesn't clarify format or constraints. This fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a comment') and target resource ('to an existing issue'), making the purpose immediately understandable. It doesn't distinguish from sibling tools like 'update_issue' or 'create_issue', but the verb+resource combination is specific enough for basic understanding.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_issue' (which might also allow commenting) or 'create_issue' (for initial issue creation with comments). There's no mention of prerequisites, constraints, or appropriate contexts for this specific commenting operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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