update_issue
Update an existing GitHub issue by modifying its title, description, state, labels, assignees, or milestone.
Instructions
Update an existing issue in a GitHub repository.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner | |
| repo | Yes | Repository name | |
| issue_number | Yes | Issue number to update | |
| title | No | New title | |
| body | No | New description | |
| state | No | New state | |
| labels | No | New labels | |
| assignees | No | New assignees | |
| milestone | No | New milestone number |
Implementation Reference
- src/tools/issues.ts:324-376 (handler)The update_issue tool handler function. It takes owner, repo, issue_number, and optional fields (title, body, state, labels, assignees, milestone), calls octokit.rest.issues.update(), and returns a formatted response with the updated issue details.
// Tool: Update Issue server.tool( "update_issue", "Update an existing issue in a GitHub repository.", { owner: z.string().describe("Repository owner"), repo: z.string().describe("Repository name"), issue_number: z.number().describe("Issue number to update"), title: z.string().optional().describe("New title"), body: z.string().optional().describe("New description"), state: z.enum(["open", "closed"]).optional().describe("New state"), labels: z.array(z.string()).optional().describe("New labels"), assignees: z.array(z.string()).optional().describe("New assignees"), milestone: z.number().optional().describe("New milestone number"), }, async ({ owner, repo, issue_number, title, body, state, labels, assignees, milestone, }) => { try { const response = await octokit.rest.issues.update({ owner, repo, issue_number, title, body, state, labels, assignees, milestone, }) const i = response.data let text = `Issue updated: **#${i.number}: ${i.title}**\n` text += `URL: ${i.html_url}\n` text += `State: ${i.state}\n` text += `Updated: ${i.updated_at}\n` return { content: [{ type: "text", text }], } } catch (e: any) { return { content: [{ type: "text", text: `Error: ${e.message}` }], } } }, ) - src/tools/issues.ts:5-5 (registration)The registerIssueTools function exports the tool registration; it's called from src/index.ts with the server and octokit instances.
export function registerIssueTools(server: McpServer, octokit: Octokit) { - src/index.ts:14-17 (registration)The central registration point that calls registerIssueTools to wire up all issue-related tools (including update_issue) to the MCP server.
export function registerAllToolsAndResources(server: McpServer, octokit: Octokit): void { registerSearchTools(server, octokit) registerIssueTools(server, octokit) registerRepositoryTools(server, octokit)