Skip to main content
Glama

update_issue

Modify Gitee repository issues by updating title, content, assignees, labels, milestone, or state to manage and organize tasks efficiently.

Instructions

更新 Gitee 仓库中的 Issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNoUsers assigned to the issue
bodyNoIssue content
issue_numberYesIssue number
labelsNoLabels
milestoneNoMilestone ID
ownerYesRepository owner path (enterprise, organization, or personal path)
repoYesRepository path
stateNoIssue state
titleNoIssue title

Implementation Reference

  • The core handler function implementing the update_issue tool logic, calling the Gitee API to update an issue.
    export async function updateIssue(
      owner: string,
      repo: string,
      issueNumber: number | string,
      options: Omit<UpdateIssueOptions, "owner" | "repo" | "issue_number">
    ) {
      owner = validateOwnerName(owner);
      repo = validateRepositoryName(repo);
    
      // Create the request body
      const body: Record<string, any> = {
        ...options,
        repo: repo  // Add repo as a request body parameter
      };
    
      // If `assignees` is an array, convert it to a comma-separated string.
      if (Array.isArray(body.assignees) && body.assignees.length > 0) {
        body.assignees = body.assignees.join(',');
      } else if (Array.isArray(body.assignees) && body.assignees.length === 0) {
        // If `assignees` is an empty array, delete the field.
        delete body.assignees;
      }
    
      // If `labels` is an array, convert it to a comma-separated string.
      if (Array.isArray(body.labels) && body.labels.length > 0) {
        body.labels = body.labels.join(',');
      } else if (Array.isArray(body.labels) && body.labels.length === 0) {
        // If `labels` is an empty array, delete the field.
        delete body.labels;
      }
    
      // Note: In the Gitee API's update issue interface, `repo` is passed as a form parameter, not as a path parameter.
      const url = `/repos/${owner}/issues/${issueNumber}`;
      const response = await giteeRequest(url, "PATCH", body);
    
      return GiteeIssueSchema.parse(response);
    }
  • Zod schema defining the input parameters for the update_issue tool.
    export const UpdateIssueOptionsSchema = 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"),
      // Issue 标题
      title: z.string().optional().describe("Issue title"),
      // Issue 内容
      body: z.string().optional().describe("Issue content"),
      // Issue 分配的用户
      assignees: z.array(z.string()).optional().describe("Users assigned to the issue"),
      // 里程碑 ID
      milestone: z.number().optional().describe("Milestone ID"),
      // 标签
      labels: z.array(z.string()).optional().describe("Labels"),
      // Issue 状态
      state: z.enum(["open", "closed", "progressing"]).optional().describe("Issue state"),
    });
  • index.ts:169-177 (registration)
    Registration of the 'update_issue' tool in the MCP server, referencing the schema and delegating to the handler.
    server.registerTool({
      name: "update_issue",
      description: "更新 Gitee 仓库中的 Issue",
      schema: issueOperations.UpdateIssueOptionsSchema,
      handler: async (params: any) => {
        const { owner, repo, issue_number, ...options } = params;
        return await issueOperations.updateIssue(owner, repo, issue_number, options);
      },
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. '更新' (update) implies a mutation operation, but the description doesn't disclose permissions required, whether partial updates are allowed, error conditions (e.g., invalid issue number), or what happens on success/failure. For a mutation tool with 9 parameters and no annotation coverage, this minimal description is inadequate.

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 Chinese sentence ('更新 Gitee 仓库中的 Issue') that directly states the tool's function. There's zero wasted verbiage or unnecessary elaboration. It's appropriately sized for a tool with comprehensive schema documentation.

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?

Given this is a mutation tool with 9 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what happens when the tool succeeds (e.g., returns updated issue object), what error conditions exist, or how it interacts with the Gitee API. The combination of mutation complexity and lack of structured metadata requires more descriptive context than provided.

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 9 parameters well-documented in the schema (e.g., assignees='Users assigned to the issue', state='Issue state' with enum values). The description adds no parameter information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 '更新 Gitee 仓库中的 Issue' clearly states the action (update) and resource (Gitee repository issue) in Chinese. It distinguishes from siblings like create_issue (creation) and get_issue (retrieval), though it doesn't explicitly mention what aspects can be updated. The purpose is clear but could be more specific about the scope of updates.

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), when to choose update_issue over create_issue for modifications, or how it differs from update_pull_request. With multiple sibling tools for issue/pull request management, this lack of contextual guidance is a significant gap.

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