get_project_v2
Retrieve detailed GitHub project V2 data using GraphQL API by providing the project's node ID. Integrates with GitHub MCP Server for enhanced project management.
Instructions
Get details of a GitHub project V2 using GraphQL API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The node ID of the project |
Implementation Reference
- operations/projectsV2.ts:117-184 (handler)The main handler function that executes the get_project_v2 tool logic by querying GitHub GraphQL API for project V2 details.export async function getProjectV2(id: string) { try { const query = ` query($id: ID!) { node(id: $id) { ... on ProjectV2 { id title shortDescription url closed createdAt updatedAt number owner { __typename ... on Organization { login } ... on User { login } } fields(first: 20) { nodes { ... on ProjectV2Field { id name } ... on ProjectV2SingleSelectField { id name options { id name color } } } } views(first: 20) { nodes { id name layout } } } } } `; const variables = { id }; const response = await graphqlRequest(query, variables); return response.data.node; } catch (error) { if (error instanceof GitHubError) { throw error; } throw new GitHubError( `Failed to get project v2: ${(error as Error).message}`, 500, { error: (error as Error).message } ); } }
- operations/projectsV2.ts:17-19 (schema)Zod schema defining the input for get_project_v2: requires 'id' as string (node ID of the project).export const GetProjectV2Schema = z.object({ id: z.string().describe("The node ID of the project") });
- index.ts:275-279 (registration)Tool registration in the MCP server: defines name, description, and input schema for get_project_v2.{ name: "get_project_v2", description: "Get details of a GitHub project V2 using GraphQL API", inputSchema: zodToJsonSchema(projectsV2.GetProjectV2Schema), },
- index.ts:748-754 (handler)Dispatcher handler case in the main CallToolRequest handler that parses args and delegates to projectsV2.getProjectV2.case "get_project_v2": { const args = projectsV2.GetProjectV2Schema.parse(request.params.arguments); const result = await projectsV2.getProjectV2(args.id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }