get_issue
Retrieve specific issues from a Gitee repository by providing the owner, repository name, and issue number. Simplifies issue management and tracking.
Instructions
获取 Gitee 仓库中的特定 Issue
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_number | Yes | Issue number | |
| owner | Yes | Repository owner path (enterprise, organization, or personal path) | |
| repo | Yes | Repository path |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"issue_number": {
"description": "Issue number",
"type": [
"number",
"string"
]
},
"owner": {
"description": "Repository owner path (enterprise, organization, or personal path)",
"type": "string"
},
"repo": {
"description": "Repository path",
"type": "string"
}
},
"required": [
"owner",
"repo",
"issue_number"
],
"type": "object"
}
Implementation Reference
- operations/issues.ts:159-170 (handler)The handler function that retrieves a specific issue from a Gitee repository by making an API request and parsing the response with GiteeIssueSchema.export async function getIssue( owner: string, repo: string, issueNumber: number | string ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `/repos/${owner}/${repo}/issues/${issueNumber}`; const response = await giteeRequest(url); return GiteeIssueSchema.parse(response);
- operations/issues.ts:52-59 (schema)Zod schema defining the input parameters for the get_issue tool: owner, repo, and issue_number.export const GetIssueSchema = 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"), });
- index.ts:159-167 (registration)Registration of the 'get_issue' tool in the MCP server, specifying name, description, schema, and handler that delegates to issueOperations.getIssue.server.registerTool({ name: "get_issue", description: "获取 Gitee 仓库中的特定 Issue", schema: issueOperations.GetIssueSchema, handler: async (params: any) => { const { owner, repo, issue_number } = params; return await issueOperations.getIssue(owner, repo, issue_number); }, });