Skip to main content
Glama

List Notifications

affine_list_notifications

Fetch user notifications from AFFiNE workspaces, allowing users to specify the number of notifications and filter for unread ones only.

Instructions

Get user notifications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNoNumber of notifications to fetch
unreadOnlyNoShow only unread notifications

Implementation Reference

  • Async handler function that executes the tool logic: fetches notifications via GraphQL query to currentUser.notifications, optionally filters to unread only, and returns the list or error message.
    const listNotificationsHandler = async ({ first = 20, unreadOnly = false }: { first?: number; unreadOnly?: boolean }) => {
      try {
        const query = `
          query GetNotifications($first: Int!) {
            currentUser {
              notifications(first: $first) {
                nodes {
                  id
                  type
                  title
                  body
                  read
                  createdAt
                }
                totalCount
                pageInfo {
                  hasNextPage
                }
              }
            }
          }
        `;
        
        const data = await gql.request<{ currentUser: { notifications: any } }>(query, { first });
        
        let notifications = data.currentUser?.notifications?.nodes || [];
        if (unreadOnly) {
          notifications = notifications.filter((n: any) => !n.read);
        }
        
        return text(notifications);
      } catch (error: any) {
        return text({ error: error.message });
      }
    };
  • Registration of the 'affine_list_notifications' tool on the MCP server, including title, description, input schema with Zod validators, and reference to the handler function.
    server.registerTool(
      "affine_list_notifications",
      {
        title: "List Notifications",
        description: "Get user notifications.",
        inputSchema: {
          first: z.number().optional().describe("Number of notifications to fetch"),
          unreadOnly: z.boolean().optional().describe("Show only unread notifications")
        }
      },
      listNotificationsHandler as any
    );
  • Input schema definition using Zod for optional parameters 'first' (number) and 'unreadOnly' (boolean).
    inputSchema: {
      first: z.number().optional().describe("Number of notifications to fetch"),
      unreadOnly: z.boolean().optional().describe("Show only unread notifications")
    }
  • Related registration of alias 'list_notifications' using the same handler and schema.
    server.registerTool(
      "list_notifications",
      {
        title: "List Notifications",
        description: "Get user notifications.",
        inputSchema: {
          first: z.number().optional().describe("Number of notifications to fetch"),
          unreadOnly: z.boolean().optional().describe("Show only unread notifications")
        }
      },
      listNotificationsHandler as any
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Get' implies a read operation, but it doesn't specify whether this requires authentication, how notifications are returned (e.g., paginated, sorted), or any rate limits. The description is too minimal to adequately inform the agent about behavioral traits.

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, efficient sentence with no wasted words. It's front-loaded with the core purpose and appropriately sized for a simple list operation, making it easy for an agent to parse quickly.

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 no annotations and no output schema, the description is insufficient. It doesn't explain what the return values look like (e.g., notification objects, pagination details) or address authentication requirements. Given the complexity of notifications and lack of structured context, more completeness is needed.

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?

The input schema has 100% description coverage, so parameters 'first' and 'unreadOnly' are fully documented in the schema. The description adds no additional parameter information beyond what's already in the structured data, meeting the baseline expectation for high schema coverage.

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 verb 'Get' and resource 'user notifications', making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'affine_read_all_notifications' or 'affine_read_notification', which would require more specific scope information to reach a score of 5.

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 'affine_read_all_notifications' or 'affine_read_notification'. There's no mention of context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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

Related 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/DAWNCR0W/affine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server