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

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "assignees": { "description": "Users assigned to the issue", "items": { "type": "string" }, "type": "array" }, "body": { "description": "Issue content", "type": "string" }, "issue_number": { "description": "Issue number", "type": [ "number", "string" ] }, "labels": { "description": "Labels", "items": { "type": "string" }, "type": "array" }, "milestone": { "description": "Milestone ID", "type": "number" }, "owner": { "description": "Repository owner path (enterprise, organization, or personal path)", "type": "string" }, "repo": { "description": "Repository path", "type": "string" }, "state": { "description": "Issue state", "enum": [ "open", "closed", "progressing" ], "type": "string" }, "title": { "description": "Issue title", "type": "string" } }, "required": [ "owner", "repo", "issue_number" ], "type": "object" }

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); }, });

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