update_project
Modify project details such as name, description, or status directly within the GitHub MCP Server. Streamline project management by updating essential information efficiently.
Instructions
Update an existing project's details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | New description of the project | |
| name | No | New name of the project | |
| project_id | Yes | The unique identifier of the project | |
| state | No | State of the project |
Implementation Reference
- operations/projects.ts:117-151 (handler)The main handler function that executes the tool logic by making a PATCH request to the GitHub Projects API to update the project's name, body, and/or state.export async function updateProject(projectId: number, name?: string, body?: string, state?: string) { try { const url = `https://api.github.com/projects/${projectId}`; const updateData: Record<string, any> = {}; if (name !== undefined) { updateData.name = name; } if (body !== undefined) { updateData.body = body; } if (state !== undefined) { updateData.state = state; } const response = await githubRequest(url, { method: 'PATCH', body: updateData, headers: { 'Accept': 'application/vnd.github.inertia-preview+json' } }); return response; } catch (error) { if (error instanceof GitHubError) { throw error; } throw new GitHubError(`Failed to update project: ${(error as Error).message}`, 500, { error: (error as Error).message }); } }
- operations/projects.ts:21-26 (schema)Zod input schema defining the parameters for updating a project: project_id (required), name/body/state (optional).export const UpdateProjectSchema = z.object({ project_id: z.number().describe("The unique identifier of the project"), name: z.string().optional().describe("New name of the project"), body: z.string().optional().describe("New description of the project"), state: z.enum(["open", "closed"]).optional().describe("State of the project"), });
- index.ts:216-219 (registration)Tool registration in the MCP server's ListTools response, specifying name, description, and input schema.name: "update_project", description: "Update an existing project's details", inputSchema: zodToJsonSchema(projects.UpdateProjectSchema), },
- index.ts:603-614 (handler)MCP server dispatch handler for 'update_project' tool call: parses input with schema and invokes the projects.updateProject function.case "update_project": { const args = projects.UpdateProjectSchema.parse(request.params.arguments); const result = await projects.updateProject( args.project_id, args.name, args.body, args.state ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }