update_project
Modify GitHub project details, including title, description, visibility, and status, ensuring accurate project management and alignment with team goals.
Instructions
Update an existing GitHub project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| projectId | Yes | ||
| status | No | ||
| title | No | ||
| visibility | No |
Implementation Reference
- Core handler that executes the update_project tool logic. Maps validated args to Partial<Project> and calls GitHubProjectRepository.update() which performs the GraphQL mutation.async updateProject(data: { projectId: string; title?: string; description?: string; visibility?: 'private' | 'public'; status?: 'active' | 'closed'; }): Promise<Project> { try { // Convert the status string to ResourceStatus enum let resourceStatus: ResourceStatus | undefined; if (data.status) { resourceStatus = data.status === 'active' ? ResourceStatus.ACTIVE : ResourceStatus.CLOSED; } // Map the data to the domain model const projectData: Partial<Project> = { title: data.title, description: data.description, visibility: data.visibility, status: resourceStatus, }; // Clean up undefined values Object.keys(projectData).forEach((key) => { if (projectData[key as keyof Partial<Project>] === undefined) { delete projectData[key as keyof Partial<Project>]; } }); return await this.projectRepo.update(data.projectId, projectData); } catch (error) { throw this.mapErrorToMCPError(error); } }
- src/index.ts:268-269 (registration)MCP server dispatcher/registration in executeToolHandler switch statement that routes 'update_project' calls to ProjectManagementService.updateProject.case "update_project": return await this.service.updateProject(args);
- Tool definition including Zod input schema, description, and usage examples for the 'update_project' tool.export const updateProjectTool: ToolDefinition<UpdateProjectArgs> = { name: "update_project", description: "Update an existing GitHub project", schema: updateProjectSchema as unknown as ToolSchema<UpdateProjectArgs>, examples: [ { name: "Update project title and visibility", description: "Change a project's title and make it public", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", title: "Updated API Development", visibility: "public" } }, { name: "Close a project", description: "Mark a project as closed", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", status: "closed" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:196-196 (registration)Registration of updateProjectTool in ToolRegistry singleton during initialization for list_tools MCP response.this.registerTool(updateProjectTool);
- Zod input validation schema used for 'update_project' tool parameter validation.export const updateProjectSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), title: z.string().optional(), description: z.string().optional(), visibility: z.enum(["private", "public"]).optional(), status: z.enum(["active", "closed"]).optional(), });