update_project
Modify GitHub project details including title, description, visibility, and status to keep project information current and aligned with development progress.
Instructions
Update an existing GitHub project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| title | No | ||
| description | No | ||
| visibility | No | ||
| status | No |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"type": "string"
},
"projectId": {
"type": "string"
},
"status": {
"enum": [
"active",
"closed"
]
},
"title": {
"type": "string"
},
"visibility": {
"enum": [
"private",
"public"
]
}
},
"required": [
"projectId"
],
"type": "object"
}
Implementation Reference
- Core handler function that executes the update_project tool logic. Validates input, maps to domain model, and calls the GitHub project repository to perform the update.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); } }
- Tool definition including Zod input schema (updateProjectSchema), 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:141-146 (registration)Registers the updateProjectTool in the central ToolRegistry, making it available for MCP list_tools requests.// Register project tools this.registerTool(createProjectTool); this.registerTool(listProjectsTool); this.registerTool(getProjectTool); this.registerTool(updateProjectTool); this.registerTool(deleteProjectTool);
- src/index.ts:249-250 (handler)MCP server dispatcher that handles call_tool requests for update_project and delegates to ProjectManagementService.case "update_project": return await this.service.updateProject(args);