delete-thread-subscription
Unsubscribe from a GitHub notification thread to stop receiving updates for that specific conversation.
Instructions
Unsubscribe from a GitHub notification thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | The ID of the notification thread to unsubscribe from |
Implementation Reference
- Main handler function that deletes the thread subscription via GitHub API, handles success, 404 (not subscribed), and other errors.export async function deleteThreadSubscriptionHandler(args: z.infer<typeof deleteThreadSubscriptionSchema>) { try { // Make request to GitHub API await githubDelete(`/notifications/threads/${args.thread_id}/subscription`); return { content: [{ type: "text", text: `Successfully unsubscribed from thread ${args.thread_id}.` }] }; } catch (error) { if (error instanceof Error && error.message.includes("404")) { return { content: [{ type: "text", text: `You were not subscribed to thread ${args.thread_id}.` }] }; } return { isError: true, content: [{ type: "text", text: formatError(`Failed to unsubscribe from thread ${args.thread_id}`, error) }] }; } }
- Zod schema defining the input parameter 'thread_id' for the tool.* Schema for delete-thread-subscription tool input parameters */ export const deleteThreadSubscriptionSchema = z.object({ thread_id: z.string().describe("The ID of the notification thread to unsubscribe from") });
- src/tools/delete-thread-subscription.ts:52-59 (registration)Registration function that registers the tool with the MCP server using server.tool(name, description, schema, handler).export function registerDeleteThreadSubscriptionTool(server: any) { server.tool( "delete-thread-subscription", "Unsubscribe from a GitHub notification thread", deleteThreadSubscriptionSchema.shape, deleteThreadSubscriptionHandler ); }
- src/server.ts:45-45 (registration)Invocation of the registration function during server startup to add the tool.registerDeleteThreadSubscriptionTool(server);