delete-thread-subscription
Stop receiving notifications for a specific GitHub thread by unsubscribing from it using the thread ID.
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
- The handler function that executes the delete-thread-subscription tool logic by calling the GitHub API to delete the subscription.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 parameters for the delete-thread-subscription tool (thread_id).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)Function that registers the delete-thread-subscription tool with the MCP server.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)Call to register the delete-thread-subscription tool during server initialization.registerDeleteThreadSubscriptionTool(server);