Skip to main content
Glama

update_pull_request

Modify and manage Gitee repository Pull Requests by updating titles, content, states, labels, assignees, or milestones directly through the MCP server.

Instructions

更新 Gitee 仓库中的 Pull Request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNoReviewers
bodyNoPull Request content
labelsNoLabels
milestone_numberNoMilestone number
ownerYesRepository owner path (enterprise, organization, or personal path)
pull_numberYesPull Request number
repoYesRepository path
stateNoPull Request state
testersNoTesters
titleNoPull Request title

Implementation Reference

  • The core handler function that performs the actual update_pull_request logic by validating inputs and making a PATCH request to the Gitee API.
    export async function updatePullRequest( owner: string, repo: string, pullNumber: number, options: Omit<UpdatePullRequestOptions, "owner" | "repo" | "pull_number"> ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `/repos/${owner}/${repo}/pulls/${pullNumber}`; const response = await giteeRequest(url, "PATCH", options); return GiteePullRequestSchema.parse(response); }
  • Zod schema defining the input structure and validation for the update_pull_request tool.
    export const UpdatePullRequestSchema = z.object({ // 仓库所属空间地址 (企业、组织或个人的地址 path) owner: z.string().describe("Repository owner path (enterprise, organization, or personal path)"), // 仓库路径 (path) repo: z.string().describe("Repository path"), // Pull Request 编号 pull_number: z.number().describe("Pull Request number"), // Pull Request 标题 title: z.string().optional().describe("Pull Request title"), // Pull Request 内容 body: z.string().optional().describe("Pull Request content"), // Pull Request 状态 state: z.enum(["open", "closed"]).optional().describe("Pull Request state"), // 里程碑序号 milestone_number: z.number().optional().describe("Milestone number"), // 标签 labels: z.array(z.string()).optional().describe("Labels"), // 审查人员 assignees: z.array(z.string()).optional().describe("Reviewers"), // 测试人员 testers: z.array(z.string()).optional().describe("Testers"), });
  • index.ts:224-236 (registration)
    Tool registration in the MCP server, which wraps and delegates to the updatePullRequest handler from pullOperations.
    server.registerTool({ name: "update_pull_request", description: "更新 Gitee 仓库中的 Pull Request", schema: pullOperations.UpdatePullRequestSchema, handler: async (params: any) => { const { owner, repo, pull_number, ...options } = params; // 确保必需参数存在 if (!owner || !repo || pull_number === undefined) { throw new Error("owner, repo 和 pull_number 参数是必需的"); } return await pullOperations.updatePullRequest(owner, repo, pull_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