Skip to main content
Glama

Mark Notification Read

affine_read_notification

Mark a notification as read in AFFiNE workspaces by specifying its ID using the GraphQL API. Simplifies notification management for streamlined workspace operations.

Instructions

Mark a notification as read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesNotification ID

Implementation Reference

  • The handler function that executes the tool logic: marks a notification as read by sending a GraphQL mutation to the server.
    const readNotificationHandler = async ({ id }: { id: string }) => {
      try {
        const mutation = `
          mutation ReadNotification($id: String!) {
            readNotification(id: $id)
          }
        `;
        
        const data = await gql.request<{ readNotification: boolean }>(mutation, { id });
        
        return text({ success: data.readNotification, notificationId: id });
      } catch (error: any) {
        return text({ error: error.message });
      }
    };
  • Tool registration call for 'affine_read_notification', including title, description, and input schema.
    server.registerTool(
      "affine_read_notification",
      {
        title: "Mark Notification Read",
        description: "Mark a notification as read.",
        inputSchema: {
          id: z.string().describe("Notification ID")
        }
      },
      readNotificationHandler as any
    );
  • Input schema definition for the tool, specifying the 'id' parameter as a string.
      inputSchema: {
        id: z.string().describe("Notification ID")
      }
    },
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. It states the mutation action ('Mark as read') but doesn't describe permissions needed, whether the change is reversible, side effects, error conditions, or what happens after marking (e.g., notification disappears from unread lists). For a mutation tool with zero annotation coverage, this is insufficient.

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 that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple single-parameter tool and front-loads the 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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after marking (success indicators, return values, or side effects), doesn't mention permissions or error cases, and provides no context about notification lifecycle or relationships to other tools.

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%, with the single parameter 'id' clearly documented as 'Notification ID' in the schema. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

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 ('Mark') and resource ('a notification') with the specific state change ('as read'). It distinguishes from sibling 'affine_read_all_notifications' by specifying single notification marking. However, it doesn't explicitly contrast with other notification-related tools like 'affine_list_notifications'.

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. It doesn't mention prerequisites (e.g., needing a notification ID from list_notifications), when not to use it, or how it differs from 'affine_read_all_notifications' beyond the obvious single vs. batch distinction.

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