Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

add-issue-comment

Add a comment to an existing GitHub issue by specifying the repository owner, repository name, issue number, and comment content.

Instructions

Add a comment to an existing issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
issue_numberYes
ownerYes
repoYes

Implementation Reference

  • The core handler function for the 'add-issue-comment' tool. It validates input using AddIssueCommentSchema, uses the GitHub API to create a comment on the specified issue, and returns the created comment details.
    export async function addIssueComment(args: unknown): Promise<any> {
      const { owner, repo, issue_number, body } = AddIssueCommentSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().issues.createComment({
          owner,
          repo,
          issue_number,
          body,
        });
    
        return {
          id: data.id,
          user: data.user ? {
            login: data.user.login,
            id: data.user.id,
          } : null,
          created_at: data.created_at,
          updated_at: data.updated_at,
          body: data.body,
          url: data.html_url,
        };
      }, 'Failed to add issue comment');
    }
  • Zod schema used for input validation in the addIssueComment handler. Extends OwnerRepoSchema with issue_number and body requirements.
    export const AddIssueCommentSchema = OwnerRepoSchema.extend({
      issue_number: z.number().int().positive(),
      body: z.string().min(1, 'Comment body is required'),
    });
  • Switch case in the CallToolRequestSchema handler that dispatches to the addIssueComment function.
    case 'add-issue-comment':
      result = await addIssueComment(parsedArgs);
      break;
  • src/server.ts:669-691 (registration)
    Tool registration in the ListToolsRequestSchema response, including name, description, and input schema (mirrors the Zod schema).
    {
      name: 'add-issue-comment',
      description: 'Add a comment to an existing issue',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
          },
          repo: {
            type: 'string',
          },
          issue_number: {
            type: 'number',
          },
          body: {
            type: 'string',
          },
        },
        required: ['owner', 'repo', 'issue_number', 'body'],
        additionalProperties: false,
      },
    },
  • JSON Schema definition for the tool input, provided in the tool list response.
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
          },
          repo: {
            type: 'string',
          },
          issue_number: {
            type: 'number',
          },
          body: {
            type: 'string',
          },
        },
        required: ['owner', 'repo', 'issue_number', 'body'],
        additionalProperties: false,
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool adds a comment but doesn't mention whether this requires authentication, what permissions are needed, if it's idempotent, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 directly states the tool's purpose with zero wasted words. It's appropriately sized for a straightforward tool and front-loads the essential information.

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 description coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameter meanings, behavioral traits, or what to expect upon completion. The description should provide more context given the lack of structured documentation.

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?

Schema description coverage is 0%, meaning none of the 4 parameters have descriptions in the schema. The tool description doesn't explain what 'owner', 'repo', 'issue_number', or 'body' mean or how they should be formatted. It adds no parameter semantics beyond what's implied by the tool name.

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'), providing specific verb+resource. However, it doesn't differentiate from potential sibling tools like 'update-issue' which might also modify issues, though the distinction is somewhat implied by the specific action of commenting.

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' for other issue modifications, nor does it mention prerequisites such as requiring an existing issue. It simply states what the tool does without contextual usage information.

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

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