Skip to main content
Glama
mcollina

GitHub Notifications MCP Server

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
NameRequiredDescriptionDefault
thread_idYesThe ID of the notification thread to mark as read

Implementation Reference

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

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