Skip to main content
Glama

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
NameRequiredDescriptionDefault
bodyNoNew description of the project
nameNoNew name of the project
project_idYesThe unique identifier of the project
stateNoState of the project

Implementation Reference

  • 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 }); } }
  • 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), },
  • 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) }], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tuanle96/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server