Skip to main content
Glama
mcollina

GitHub Notifications MCP Server

mark-repo-notifications-read

Mark GitHub notifications for a specific repository as read or unread to manage your notification inbox and reduce clutter.

Instructions

Mark GitHub notifications for a specific repository as read

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe account owner of the repository
repoYesThe name of the repository
last_read_atNoISO 8601 timestamp - marks notifications updated at or before this time as read. Default is current time.
readNoWhether to mark notifications as read or unread

Implementation Reference

  • The asynchronous handler function that processes the tool input, calls the GitHub API to mark repo notifications as read/unread, handles responses and errors.
    export async function markRepoNotificationsReadHandler(args: z.infer<typeof markRepoNotificationsReadSchema>) { try { // Prepare request body const requestBody = { last_read_at: args.last_read_at, read: args.read }; // Make request to GitHub API const response = await githubPut<MarkNotificationsReadResponse>( `/repos/${args.owner}/${args.repo}/notifications`, requestBody ); // Check if notifications are processed asynchronously if (response.message) { return { content: [{ type: "text", text: `${response.message}` }] }; } // Default success message return { content: [{ type: "text", text: `Successfully marked notifications for repository ${args.owner}/${args.repo} as ${args.read ? 'read' : 'unread'}.${ args.last_read_at ? ` Notifications updated on or before ${new Date(args.last_read_at).toLocaleString()} were affected.` : '' }` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: formatError(`Failed to mark notifications as read for repository ${args.owner}/${args.repo}`, error) }] }; } }
  • Zod schema for input validation: owner (string), repo (string), last_read_at (optional string), read (optional boolean, default true).
    export const markRepoNotificationsReadSchema = z.object({ owner: z.string().describe("The account owner of the repository"), repo: z.string().describe("The name of the repository"), last_read_at: z.string().optional().describe( "ISO 8601 timestamp - marks notifications updated at or before this time as read. Default is current time." ), read: z.boolean().optional().default(true).describe( "Whether to mark notifications as read or unread" ) });
  • Registers the tool with the MCP server by calling server.tool() with the tool name, description, schema, and handler reference.
    /** * Register this tool with the server */ export function registerMarkRepoNotificationsReadTool(server: any) { server.tool( "mark-repo-notifications-read", "Mark GitHub notifications for a specific repository as read", markRepoNotificationsReadSchema.shape, markRepoNotificationsReadHandler ); }
  • src/server.ts:46-47 (registration)
    Invokes the registration function for this tool during server initialization.
    registerListRepoNotificationsTool(server); registerMarkRepoNotificationsReadTool(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