github_activity_get_thread_subscription_for_authenticated_user
Retrieve the subscription status of a specific notification thread for the authenticated GitHub user.
Instructions
Get a thread subscription for the authenticated user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | thread_id |
Implementation Reference
- src/tools/activity.ts:94-101 (handler)Handler function for 'github_activity_get_thread_subscription_for_authenticated_user'. Makes a GET request to /notifications/threads/{thread_id}/subscription to retrieve the authenticated user's subscription for a specific thread.
name: "github_activity_get_thread_subscription_for_authenticated_user", description: "Get a thread subscription for the authenticated user", inputSchema: z.object({ thread_id: z.string().describe("thread_id") }), handler: async (args: Record<string, any>) => { return githubRequest("GET", `/notifications/threads/${args.thread_id}/subscription`, undefined, undefined); }, - src/tools/activity.ts:96-98 (schema)Input schema for the tool: requires a thread_id string parameter.
inputSchema: z.object({ thread_id: z.string().describe("thread_id") }), - src/index.ts:108-110 (registration)General tool registration loop: all tools (including this one) are registered with the MCP server via server.tool() using their name, description, schema, and handler.
.flatMap((m) => m.tools); for (const tool of allTools) { - src/index.ts:55-57 (registration)The activityTools array (containing this tool) is included in the allToolModules list, making it available for registration under the 'activity' category.
const allToolModules = [ { category: "actions", tools: actionsTools }, { category: "activity", tools: activityTools }, - src/client.ts:9-46 (helper)The githubRequest helper function used by the handler to make HTTP requests to the GitHub API.
export async function githubRequest<T>( method: string, path: string, body?: Record<string, unknown>, params?: Record<string, string | number | boolean | string[] | undefined> ): Promise<T> { const url = new URL(`${BASE_URL}${path}`); if (params) { for (const [key, value] of Object.entries(params)) { if (value === undefined || value === null || value === "") continue; if (Array.isArray(value)) { url.searchParams.set(key, value.join(",")); } else { url.searchParams.set(key, String(value)); } } } const headers: Record<string, string> = { Authorization: `Bearer ${getToken()}`, Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", "User-Agent": "github-mcp/1.0.0", }; if (body) { headers["Content-Type"] = "application/json"; } const res = await fetch(url.toString(), { method, headers, body: body ? JSON.stringify(body) : undefined, }); if (!res.ok) { const text = await res.text().catch(() => "");