get-thread
Retrieve detailed information about a specific GitHub notification thread by providing its thread ID to manage notifications effectively.
Instructions
Get information about a GitHub notification thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | The ID of the notification thread to retrieve |
Implementation Reference
- src/tools/get-thread.ts:19-42 (handler)The getThreadHandler function implements the core logic of the 'get-thread' tool: fetches the GitHub notification thread by ID, formats it, and returns the response or error.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) }] }; } }
- src/tools/get-thread.ts:12-14 (schema)Zod schema defining the input parameter 'thread_id' for the 'get-thread' tool.export const getThreadSchema = z.object({ thread_id: z.string().describe("The ID of the notification thread to retrieve") });
- src/tools/get-thread.ts:47-54 (registration)The registerGetThreadTool function registers the 'get-thread' tool with the MCP server, specifying name, description, input schema, and handler.export function registerGetThreadTool(server: any) { server.tool( "get-thread", "Get information about a GitHub notification thread", getThreadSchema.shape, getThreadHandler ); }
- src/server.ts:40-40 (registration)Invocation of the registerGetThreadTool function during server initialization to register the tool.registerGetThreadTool(server);