mark-thread-read
Mark GitHub notification threads as read to manage your inbox and reduce clutter. This tool helps you clear specific notifications by thread ID.
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 main handler function that marks the specified GitHub notification thread as read by patching the GitHub API endpoint. Handles success and error responses.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 defining the input parameters for the tool: a single string 'thread_id'.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:40-50 (registration)Function exported to register the 'mark-thread-read' tool with the MCP server, providing name, description, schema shape, and handler./** * Register this tool with the server */ 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)Call to the registration function during server initialization to add the tool to the MCP server.registerMarkThreadReadTool(server);