Skip to main content
Glama

list_pull_requests

Retrieve Pull Requests from Gitee repositories by specifying owner, repo, state, sort, and other filters to manage PRs effectively.

Instructions

列出 Gitee 仓库中的 Pull Requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNoSort directiondesc
labelsNoLabels, multiple labels separated by commas
milestoneNoMilestone ID
ownerYesRepository owner path (enterprise, organization, or personal path)
pageNoPage number
per_pageNoNumber of items per page, maximum 100
repoYesRepository path
sortNoSort fieldcreated
stateNoPull Request stateopen

Implementation Reference

  • The main handler function that lists pull requests by constructing the Gitee API URL with query parameters from options and fetching/parsing the response.
    export async function listPullRequests( owner: string, repo: string, options: Omit<ListPullRequestsOptions, "owner" | "repo"> ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = new URL(`${getGiteeApiBaseUrl()}/repos/${owner}/${repo}/pulls`); // Add query parameters Object.entries(options).forEach(([key, value]) => { if (value !== undefined) { url.searchParams.append(key, value.toString()); } }); const response = await giteeRequest(url.toString(), "GET"); return z.array(GiteePullRequestSchema).parse(response); }
  • Zod schema defining the input parameters for the list_pull_requests tool, including owner, repo, pagination, filtering, and sorting options.
    export const ListPullRequestsSchema = z.object({ // 仓库所属空间地址 (企业、组织或个人的地址 path) owner: z.string().describe("Repository owner path (enterprise, organization, or personal path)"), // 仓库路径 (path) repo: z.string().describe("Repository path"), // Pull Request 状态 state: z.enum(["open", "closed", "merged", "all"]).default("open").optional().describe("Pull Request state"), // 排序字段 sort: z.enum(["created", "updated", "popularity", "long-running"]).default("created").optional().describe("Sort field"), // 排序方向 direction: z.enum(["asc", "desc"]).default("desc").optional().describe("Sort direction"), // 里程碑 ID milestone: z.number().optional().describe("Milestone ID"), // 标签,多个标签以逗号分隔 labels: z.string().optional().describe("Labels, multiple labels separated by commas"), // 当前的页码 page: z.number().int().default(1).optional().describe("Page number"), // 每页的数量,最大为 100 per_page: z.number().int().min(1).max(100).optional().describe("Number of items per page, maximum 100"), });
  • index.ts:204-212 (registration)
    Registers the list_pull_requests tool with the MCP server, using the schema from pullOperations and delegating to the listPullRequests handler.
    server.registerTool({ name: "list_pull_requests", description: "列出 Gitee 仓库中的 Pull Requests", schema: pullOperations.ListPullRequestsSchema, handler: async (params: any) => { const { owner, repo, ...options } = params; return await pullOperations.listPullRequests(owner, repo, 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