update_issue
Modify existing GitHub issues by updating titles, descriptions, assignees, labels, milestones, or status to track project changes and progress.
Instructions
Update an existing issue in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| issue_number | Yes | ||
| title | No | ||
| body | No | ||
| assignees | No | ||
| milestone | No | ||
| labels | No | ||
| state | No |
Implementation Reference
- src/operations/issues.ts:130-145 (handler)The core handler function that performs the GitHub API PATCH request to update an issue with the provided options.export async function updateIssue( github_pat: string, owner: string, repo: string, issue_number: number, options: Omit<z.infer<typeof UpdateIssueOptionsSchema>, "owner" | "repo" | "issue_number"> ) { return githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}`, { method: "PATCH", body: options, } ); }
- src/operations/issues.ts:59-69 (schema)Zod schema defining the input parameters for the update_issue tool, including required owner, repo, issue_number and optional update fields.export const UpdateIssueOptionsSchema = z.object({ owner: z.string(), repo: z.string(), issue_number: z.number(), title: z.string().optional(), body: z.string().optional(), assignees: z.array(z.string()).optional(), milestone: z.number().optional(), labels: z.array(z.string()).optional(), state: z.enum(["open", "closed"]).optional(), });
- src/index.ts:134-137 (registration)Registration of the update_issue tool in the MCP server's listTools response, specifying name, description, and input schema.name: "update_issue", description: "Update an existing issue in a GitHub repository", inputSchema: zodToJsonSchema(issues.UpdateIssueOptionsSchema) },
- src/index.ts:491-498 (registration)Handler case in the MCP server's CallToolRequest switch that parses arguments, calls the updateIssue function, and formats the response.case "update_issue": { const argsWithPat = issues._UpdateIssueOptionsSchema.parse(params.arguments); const { github_pat, owner, repo, issue_number, ...options } = argsWithPat; const result = await issues.updateIssue(github_pat, owner, repo, issue_number, options); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/operations/issues.ts:71-73 (schema)Extended schema used internally for parsing tool arguments, adding the github_pat field.export const _UpdateIssueOptionsSchema = UpdateIssueOptionsSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });