get_project
Retrieve detailed information about a specific GitHub project by providing the repository owner, repository name, and project number to streamline project management and tracking.
Instructions
Get details about a specific project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| project_number | Yes | The project number | |
| repo | Yes | Repository name |
Implementation Reference
- operations/projects.ts:154-175 (handler)Core handler function that retrieves a specific GitHub project by owner, repo, and project number by listing all projects in the repo and filtering.export async function getProject(owner: string, repo: string, projectNumber: number) { try { const url = `https://api.github.com/repos/${owner}/${repo}/projects`; const projects = await githubRequest(url) as any[]; // Tìm project theo number const project = projects.find((p: any) => p.number === projectNumber); if (!project) { throw new GitHubError(`Project with number ${projectNumber} not found`, 404, { message: `Project ${projectNumber} not found` }); } return project; } catch (error) { if (error instanceof GitHubError) { throw error; } throw new GitHubError(`Failed to get project: ${(error as Error).message}`, 500, { error: (error as Error).message }); } }
- operations/projects.ts:14-18 (schema)Zod schema defining the input parameters for the get_project tool.export const GetProjectSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), project_number: z.number().describe("The project number"), });
- index.ts:206-208 (registration)Tool registration in the MCP server's list of tools, specifying name, description, and input schema.name: "get_project", description: "Get details about a specific project", inputSchema: zodToJsonSchema(projects.GetProjectSchema),
- index.ts:591-601 (handler)MCP request handler case that parses arguments, calls the getProject function, and formats the response.case "get_project": { const args = projects.GetProjectSchema.parse(request.params.arguments); const result = await projects.getProject( args.owner, args.repo, args.project_number ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }