Skip to main content
Glama
mcollina

GitHub Notifications MCP Server

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
NameRequiredDescriptionDefault
thread_idYesThe 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")
    });
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcollina/mcp-github-notifications'

If you have feedback or need assistance with the MCP directory API, please join our Discord server