update_issue
Modify existing issues in GitHub repositories by updating titles, descriptions, assignees, milestones, labels, and status. Simplify issue management and collaboration across projects.
Instructions
Update an existing issue in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignees | No | ||
| body | No | ||
| issue_number | Yes | ||
| labels | No | ||
| milestone | No | ||
| owner | Yes | ||
| repo | Yes | ||
| state | No | ||
| title | No |
Implementation Reference
- operations/issues.ts:113-126 (handler)The core handler function that executes the tool logic by making a PATCH request to the GitHub Issues API to update the specified issue.export async function updateIssue( owner: string, repo: string, issue_number: number, options: Omit<z.infer<typeof UpdateIssueOptionsSchema>, "owner" | "repo" | "issue_number"> ) { return githubRequest( `https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}`, { method: "PATCH", body: options, } ); }
- operations/issues.ts:44-54 (schema)Zod schema defining the input options for the update_issue tool, including owner, repo, issue_number, and optional fields like title, body, assignees, etc.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(), });
- index.ts:126-129 (registration)Tool registration in the ListTools response, specifying name, description, and input schema.name: "update_issue", description: "Update an existing issue in a GitHub repository", inputSchema: zodToJsonSchema(issues.UpdateIssueOptionsSchema) },
- index.ts:450-457 (handler)Dispatch handler in the central CallToolRequest switch that parses arguments and calls the updateIssue function.case "update_issue": { const args = issues.UpdateIssueOptionsSchema.parse(request.params.arguments); const { owner, repo, issue_number, ...options } = args; const result = await issues.updateIssue(owner, repo, issue_number, options); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }