update_project_v2
Modify GitHub project V2 details using GraphQL API, including title, description, and project status, by providing the project ID and desired updates.
Instructions
Update a GitHub project V2 using GraphQL API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| closed | No | Whether to close the project | |
| description | No | New description for the project | |
| projectId | Yes | The node ID of the project | |
| title | No | New title for the project |
Implementation Reference
- operations/projectsV2.ts:244-292 (handler)Core handler function that executes the GraphQL mutation to update a GitHub Project V2.export async function updateProjectV2(projectId: string, title?: string, description?: string, closed?: boolean) { try { const query = ` mutation($input: UpdateProjectV2Input!) { updateProjectV2(input: $input) { projectV2 { id title shortDescription url closed createdAt updatedAt number } } } `; const input: Record<string, any> = { projectId }; if (title !== undefined) { input.title = title; } if (description !== undefined) { input.shortDescription = description; } if (closed !== undefined) { input.closed = closed; } const variables = { input }; const response = await graphqlRequest(query, variables); return response.data.updateProjectV2.projectV2; } catch (error) { if (error instanceof GitHubError) { throw error; } throw new GitHubError( `Failed to update project v2: ${(error as Error).message}`, 500, { error: (error as Error).message } ); } }
- operations/projectsV2.ts:29-34 (schema)Zod input schema for validating tool arguments.export const UpdateProjectV2Schema = z.object({ projectId: z.string().describe("The node ID of the project"), title: z.string().optional().describe("New title for the project"), description: z.string().optional().describe("New description for the project"), closed: z.boolean().optional().describe("Whether to close the project") });
- index.ts:285-289 (registration)Tool registration in the ListTools response.{ name: "update_project_v2", description: "Update a GitHub project V2 using GraphQL API", inputSchema: zodToJsonSchema(projectsV2.UpdateProjectV2Schema), },
- index.ts:768-779 (handler)Dispatch handler case that parses arguments and invokes the core updateProjectV2 function.case "update_project_v2": { const args = projectsV2.UpdateProjectV2Schema.parse(request.params.arguments); const result = await projectsV2.updateProjectV2( args.projectId, args.title, args.description, args.closed ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }