Skip to main content
Glama
mcollina

GitHub Notifications MCP Server

manage-repo-subscription

Control GitHub repository notification settings to customize which activities trigger alerts, including watching all, participating only, or muting notifications.

Instructions

Manage repository subscription settings including fine-grained notification preferences

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe account owner of the repository. The name is not case sensitive.
repoYesThe name of the repository without the .git extension. The name is not case sensitive.
actionYesThe action to perform: all_activity (watch all), default (participating and @mentions only), ignore (mute notifications), or get (view current settings)
optionsNoOptional settings for custom subscription configuration

Implementation Reference

  • The main handler function that executes the tool logic. It processes the input parameters and performs GitHub API calls based on the 'action' (get, all_activity, default, ignore).
    export async function manageRepoSubscriptionHandler(args: ManageRepoSubscriptionArgs) {
        const { owner, repo, action, options } = args;
    
        try {
            switch (action) {
                case 'get':
                    try {
                        const response = await githubGet<SubscriptionResponse>(`/repos/${owner}/${repo}/subscription`);
                        const formattedDate = new Date(response.created_at).toLocaleString();
                        return {
                            content: [{
                                type: 'text',
                                text: `Subscription status for ${owner}/${repo}:
    • API Subscription: ${response.subscribed ? 'Watching all activity' : 'Not watching'}
    • Notifications: ${response.ignored ? 'Ignored' : 'Active'}
    • Created at: ${formattedDate}
    • Web Interface: https://github.com/${owner}/${repo}`
                            }]
                        };
                    } catch (error: any) {
                        // Special handling for 404 in get action - could be default or custom settings
                        if (error.message?.includes('Resource not found')) {
                            return {
                                content: [{
                                    type: 'text',
                                    text: `Subscription status for ${owner}/${repo}:
    • Default settings (participating and @mentions only)
    • or Custom through the GitHub web interface at:
      https://github.com/${owner}/${repo}`
                                }]
                            };
                        }
                        throw error; // Re-throw other errors to be handled by the outer catch
                    }
    
                case 'all_activity':
                    await githubPut(`/repos/${owner}/${repo}/subscription`, {
                        subscribed: true,
                        ignored: false
                    });
                    return {
                        content: [{
                            type: 'text',
                            text: `Successfully set ${owner}/${repo} to watch all activity`
                        }]
                    };
    
                case 'default':
                    await githubDelete(`/repos/${owner}/${repo}/subscription`);
                    return {
                        content: [{
                            type: 'text',
                            text: `Successfully set ${owner}/${repo} to default settings (participating and @mentions only)`
                        }]
                    };
    
                case 'ignore':
                    await githubPut(`/repos/${owner}/${repo}/subscription`, {
                        subscribed: false,
                        ignored: true
                    });
                    return {
                        content: [{
                            type: 'text',
                            text: `Successfully set ${owner}/${repo} to ignore all notifications`
                        }]
                    };
            }
        } catch (error: any) {
            return {
                isError: true,
                content: [{
                    type: 'text',
                    text: formatError(`Failed to manage repository subscription for ${owner}/${repo}`, error)
                }]
            };
        }
    }
  • Zod schema defining the input parameters for the manage-repo-subscription tool, including owner, repo, action, and optional options.
    export const manageRepoSubscriptionSchema = z.object({
        owner: z.string().min(1, 'Repository owner is required')
            .describe('The account owner of the repository. The name is not case sensitive.'),
        repo: z.string().min(1, 'Repository name is required')
            .describe('The name of the repository without the .git extension. The name is not case sensitive.'),
        action: z.enum(['all_activity', 'default', 'ignore', 'get'])
            .describe('The action to perform: all_activity (watch all), default (participating and @mentions only), ignore (mute notifications), or get (view current settings)'),
        options: z.object({
            subscribed: z.boolean().optional()
                .describe('Whether to receive notifications from this repository'),
            ignored: z.boolean().optional()
                .describe('Whether to ignore all notifications from this repository')
        }).optional()
            .describe('Optional settings for custom subscription configuration')
    });
  • Registers the manage-repo-subscription tool with the MCP server, specifying name, description, schema, and handler.
    export function registerManageRepoSubscriptionTool(server: any) {
        server.tool(
            'manage-repo-subscription',
            'Manage repository subscription settings including fine-grained notification preferences',
            manageRepoSubscriptionSchema.shape,
            manageRepoSubscriptionHandler
        );
    } 
  • src/server.ts:48-48 (registration)
    Calls the registration function to add the tool during server initialization.
    registerManageRepoSubscriptionTool(server);
  • src/server.ts:18-18 (registration)
    Imports the registration function for the manage-repo-subscription tool.
    import { registerManageRepoSubscriptionTool } from "./tools/manage-repo-subscription.js";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'manage' implies mutation capabilities, the description doesn't specify what permissions are required, whether changes are reversible, what happens to existing settings, or what the response format looks like. For a tool with 4 parameters and no annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point. It's appropriately sized for the tool's complexity and doesn't waste words, though it could potentially be more front-loaded with critical usage information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like authentication requirements, error conditions, or return values. While the schema covers parameter documentation well, the description fails to provide the contextual information needed for an agent to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description mentions 'fine-grained notification preferences' which aligns with the 'action' enum values and 'options' object, but doesn't add meaningful semantic context beyond what's already in the parameter descriptions. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as managing repository subscription settings with fine-grained notification preferences. It specifies the resource (repository subscription settings) and the scope (notification preferences), but doesn't explicitly differentiate from sibling tools like 'set-thread-subscription' or 'get-thread-subscription' that handle thread-specific subscriptions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools dealing with subscriptions and notifications (e.g., 'set-thread-subscription', 'list-repo-notifications'), but the description doesn't explain when this repository-level subscription tool is appropriate versus thread-level or notification listing tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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