Skip to main content
Glama

GitHub Notifications MCP Server

get-thread.ts1.43 kB
/** * Tool implementation for getting a GitHub notification thread */ import { z } from "zod"; import { githubGet } from "../utils/api.js"; import { formatNotification, formatError } from "../utils/formatters.js"; import { NotificationResponse } from "../types/github-api.js"; /** * Schema for get-thread tool input parameters */ export const getThreadSchema = z.object({ thread_id: z.string().describe("The ID of the notification thread to retrieve") }); /** * Tool implementation for getting a GitHub notification thread */ export async function getThreadHandler(args: z.infer<typeof getThreadSchema>) { try { // Make request to GitHub API const thread = await githubGet<NotificationResponse>(`/notifications/threads/${args.thread_id}`); // Format the thread for better readability const formattedThread = formatNotification(thread); return { content: [{ type: "text", text: `Thread details:\n\n${formattedThread}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: formatError(`Failed to fetch thread ${args.thread_id}`, error) }] }; } } /** * Register this tool with the server */ export function registerGetThreadTool(server: any) { server.tool( "get-thread", "Get information about a GitHub notification thread", getThreadSchema.shape, getThreadHandler ); }

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