Skip to main content
Glama

add_issue_comment

Add comments to issues in Gitee repositories by specifying the repository owner, repo, issue number, and comment content.

Instructions

向 Gitee 仓库中的 Issue 添加评论

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesComment content
issue_numberYesIssue number
ownerYesRepository owner path (enterprise, organization, or personal path)
repoYesRepository path

Implementation Reference

  • The async function that implements the logic to add a comment to a Gitee issue by making a POST request to the Gitee API.
    export async function addIssueComment(
      owner: string,
      repo: string,
      issueNumber: number | string,
      body: string
    ) {
      owner = validateOwnerName(owner);
      repo = validateRepositoryName(repo);
    
      const url = `/repos/${owner}/${repo}/issues/${issueNumber}/comments`;
      const response = await giteeRequest(url, "POST", { body });
    
      return GiteeIssueCommentSchema.parse(response);
    }
  • Zod schema defining the input parameters for adding an issue comment: owner, repo, issue_number, body.
    export const IssueCommentSchema = z.object({
      // 仓库所属空间地址 (企业、组织或个人的地址 path)
      owner: z.string().describe("Repository owner path (enterprise, organization, or personal path)"),
      // 仓库路径 (path)
      repo: z.string().describe("Repository path"),
      // Issue 编号
      issue_number: z.union([z.number(), z.string()]).describe("Issue number"),
      // 评论内容
      body: z.string().describe("Comment content"),
    });
  • index.ts:179-187 (registration)
    Registers the 'add_issue_comment' tool with the MCP server, linking the schema and handler from issueOperations.
    server.registerTool({
      name: "add_issue_comment",
      description: "向 Gitee 仓库中的 Issue 添加评论",
      schema: issueOperations.IssueCommentSchema,
      handler: async (params: any) => {
        const { owner, repo, issue_number, body } = params;
        return await issueOperations.addIssueComment(owner, repo, issue_number, body);
      },
    });
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. It states the tool adds a comment but doesn't describe what happens after submission (e.g., whether it returns the created comment, error handling for invalid inputs, authentication requirements, or rate limits). 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 in Chinese that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero wasted text.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., comment object, success status), error conditions, or behavioral nuances like whether comments are editable after creation. Given the complexity of interacting with a Gitee API, more context is needed for effective agent use.

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

Parameters3/5

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

Schema description coverage is 100%, with all parameters clearly documented in the input schema (owner, repo, issue_number, body). The description adds no additional parameter semantics beyond what's already in the schema, such as format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('添加评论' means 'add comment') and target resource ('Gitee 仓库中的 Issue' means 'Issue in Gitee repository'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from potential alternatives like 'update_issue' which might also allow comment modifications, leaving room for sibling differentiation.

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. It doesn't mention prerequisites (e.g., needing an existing issue), exclusions, or comparisons to sibling tools like 'update_issue' that might also handle comments. The agent must infer usage from the tool name alone.

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

Related 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/normal-coder/gitee-mcp-server'

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