Skip to main content
Glama
mcollina

GitHub Notifications MCP Server

list-repo-notifications

Retrieve and manage GitHub notifications for a specific repository, including filtering by participation status, read/unread status, and time ranges.

Instructions

List GitHub notifications for a specific repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe account owner of the repository
repoYesThe name of the repository
allNoIf true, show notifications marked as read
participatingNoIf true, only shows notifications where user is directly participating
sinceNoISO 8601 timestamp - only show notifications updated after this time
beforeNoISO 8601 timestamp - only show notifications updated before this time
pageNoPage number for pagination
per_pageNoNumber of results per page (max 100)

Implementation Reference

  • The handler function that fetches repository notifications from the GitHub API, handles pagination and errors, and formats the response.
    export async function listRepoNotificationsHandler(args: z.infer<typeof listRepoNotificationsSchema>) {
      try {
        const perPage = args.per_page || 30;
        const page = args.page || 1;
        
        // Make request to GitHub API
        const notifications = await githubGet<NotificationResponse[]>(`/repos/${args.owner}/${args.repo}/notifications`, {
          params: {
            all: args.all,
            participating: args.participating,
            since: args.since,
            before: args.before,
            page: page,
            per_page: perPage,
          }
        });
    
        // If no notifications, return simple message
        if (notifications.length === 0) {
          return {
            content: [{
              type: "text",
              text: `No notifications found for repository ${args.owner}/${args.repo} with the given criteria.`
            }]
          };
        }
    
        // Format the notifications for better readability
        const formattedNotifications = notifications.map(formatNotification).join("\n\n");
        
        // Check for pagination - simplified approach without headers
        let paginationInfo = "";
        
        if (notifications.length === perPage) {
          paginationInfo = "\n\nMore notifications may be available. You can view the next page by specifying 'page: " + 
            (page + 1) + "' in the request.";
        }
    
        return {
          content: [{
            type: "text",
            text: `${notifications.length} notifications found for repository ${args.owner}/${args.repo}:
    
    ${formattedNotifications}${paginationInfo}`
          }]
        };
      } catch (error) {
        return {
          isError: true,
          content: [{
            type: "text",
            text: formatError(`Failed to fetch notifications for repository ${args.owner}/${args.repo}`, error)
          }]
        };
      }
    }
  • Zod schema defining the input parameters for the list-repo-notifications tool, including repository details and filtering options.
    export const listRepoNotificationsSchema = z.object({
      owner: z.string().describe("The account owner of the repository"),
      repo: z.string().describe("The name of the repository"),
      all: z.boolean().optional().describe("If true, show notifications marked as read"),
      participating: z.boolean().optional().describe("If true, only shows notifications where user is directly participating"),
      since: z.string().optional().describe("ISO 8601 timestamp - only show notifications updated after this time"),
      before: z.string().optional().describe("ISO 8601 timestamp - only show notifications updated before this time"),
      page: z.number().optional().describe("Page number for pagination"),
      per_page: z.number().optional().describe("Number of results per page (max 100)")
    });
  • Registers the tool with the MCP server by calling server.tool with the name, description, schema, and handler.
    export function registerListRepoNotificationsTool(server: any) {
      server.tool(
        "list-repo-notifications",
        "List GitHub notifications for a specific repository",
        listRepoNotificationsSchema.shape,
        listRepoNotificationsHandler
      );
    }
  • src/server.ts:46-46 (registration)
    Invokes the registration function during server initialization to add the tool.
    registerListRepoNotificationsTool(server);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it's a list operation (implying read-only) but doesn't mention authentication requirements, rate limits, pagination behavior (beyond what's in schema), or what the output contains. For a tool with 8 parameters and no output schema, this leaves significant gaps.

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

Conciseness5/5

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

The description is a single, clear sentence that efficiently conveys the core purpose without unnecessary words. It's appropriately sized and front-loaded with essential 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?

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what kind of notifications are returned, how to interpret results, or provide context about GitHub's notification system. The agent would struggle to use this effectively without external knowledge.

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 fully documents all 8 parameters. The description adds no parameter-specific information beyond implying repository context for 'owner' and 'repo'. This meets the baseline of 3 when schema does the heavy lifting, but doesn't enhance understanding.

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 action ('List') and resource ('GitHub notifications for a specific repository'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'list-notifications', which appears to be a broader version without repository specificity.

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 like 'list-notifications' (for all notifications) or 'mark-repo-notifications-read' (for marking as read). It mentions 'specific repository' but doesn't clarify use cases or prerequisites beyond that implied scope.

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