mark-thread-read
Mark a GitHub notification thread as read to clean up your notification list and focus on unread items.
Instructions
Mark a GitHub notification thread as read
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | The ID of the notification thread to mark as read |
Implementation Reference
- src/tools/mark-thread-read.ts:18-38 (handler)The markThreadReadHandler function that executes the tool logic: calls GitHub API to mark the notification thread as read and returns success/error response.export async function markThreadReadHandler(args: z.infer<typeof markThreadReadSchema>) { try { // Make request to GitHub API await githubPatch(`/notifications/threads/${args.thread_id}`); return { content: [{ type: "text", text: `Successfully marked thread ${args.thread_id} as read.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: formatError(`Failed to mark thread ${args.thread_id} as read`, error) }] }; } }
- src/tools/mark-thread-read.ts:11-13 (schema)Zod schema for input validation: requires thread_id string.export const markThreadReadSchema = z.object({ thread_id: z.string().describe("The ID of the notification thread to mark as read") });
- src/tools/mark-thread-read.ts:43-50 (registration)Registers the 'mark-thread-read' tool with the MCP server, providing name, description, schema, and handler.export function registerMarkThreadReadTool(server: any) { server.tool( "mark-thread-read", "Mark a GitHub notification thread as read", markThreadReadSchema.shape, markThreadReadHandler ); }
- src/server.ts:41-41 (registration)Calls the registration function during server initialization to add the tool.registerMarkThreadReadTool(server);