get_pull_request
Retrieve specific Pull Request details from Gitee repositories by providing the owner, repository path, and PR number to manage and review code changes efficiently.
Instructions
获取 Gitee 仓库中的特定 Pull Request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner path (enterprise, organization, or personal path) | |
| pull_number | Yes | Pull Request number | |
| repo | Yes | Repository path |
Implementation Reference
- operations/pulls.ts:148-160 (handler)The core handler function that validates inputs, constructs the Gitee API URL for fetching a specific pull request, makes the GET request, and parses the response using GiteePullRequestSchema.export async function getPullRequest( owner: string, repo: string, pullNumber: number ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `/repos/${owner}/${repo}/pulls/${pullNumber}`; const response = await giteeRequest(url, "GET"); return GiteePullRequestSchema.parse(response); }
- operations/pulls.ts:54-61 (schema)Zod schema defining the input parameters for the get_pull_request tool: owner, repo, and pull_number.export const GetPullRequestSchema = 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"), });
- index.ts:214-222 (registration)Registers the 'get_pull_request' tool on the MCP server, providing the name, description, schema from pullOperations, and a handler that extracts parameters and delegates to the pullOperations.getPullRequest function.server.registerTool({ name: "get_pull_request", description: "获取 Gitee 仓库中的特定 Pull Request", schema: pullOperations.GetPullRequestSchema, handler: async (params: any) => { const { owner, repo, pull_number } = params; return await pullOperations.getPullRequest(owner, repo, pull_number); }, });