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);
      },
    });
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 action is an update but doesn't cover critical traits: required permissions (e.g., write access), whether changes are reversible, rate limits, or what happens to unspecified fields (partial vs. full updates). For a mutation tool with 10 parameters, this lack of context is a significant gap.

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 ('更新 Gitee 仓库中的 Pull Request'), which translates to 'Update Pull Request in Gitee repository'. It's front-loaded with the core action and resource, with zero wasted words. This is appropriately concise for the tool's purpose.

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 the complexity (10 parameters, mutation tool, no annotations, no output schema), the description is incomplete. It doesn't address behavioral aspects like authentication needs, error handling, or return values. For a tool that modifies Pull Requests with multiple fields, more context is needed to guide an AI agent effectively.

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%, meaning all parameters are documented in the input schema. The description adds no additional meaning beyond the generic 'update' action—it doesn't explain parameter interactions, defaults, or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '更新 Gitee 仓库中的 Pull Request' clearly states the action (update) and resource (Pull Request in Gitee repository), which is better than a tautology. However, it doesn't differentiate from sibling tools like 'update_issue' or specify what aspects can be updated beyond the generic term. It's vague about the scope of updates compared to alternatives.

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., existing Pull Request), exclusions, or compare to siblings like 'merge_pull_request' or 'create_pull_request'. Usage is implied from the name but not explicitly stated, leaving gaps for an AI agent.

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