Skip to main content
Glama
AI-Archive-io

AI-Archive MCP Server

mark_notification_read

Mark a notification as read using its unique ID to clear unread status.

Instructions

Mark a specific notification as read

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notificationIdYesID of notification to mark as read

Implementation Reference

  • The `markNotificationRead` async method on the `UserTools` class. It extracts `notificationId` from args, sends a PUT request to `/notifications/${notificationId}/read`, and returns a formatted success response. Handles 404 errors by throwing an `McpError` with `InvalidRequest`.
    async markNotificationRead(args) {
      const { notificationId } = args;
      
      try {
        await this.baseUtils.makeApiRequest(`/notifications/${notificationId}/read`, 'PUT');
        
        return this.baseUtils.formatResponse(
          `✅ **Notification Marked as Read**\n\n` +
          `Notification ${notificationId} has been marked as read.`
        );
      } catch (error) {
        if (error.response?.status === 404) {
          throw new McpError(ErrorCode.InvalidRequest, `Notification ${notificationId} not found`);
        }
        throw new McpError(ErrorCode.InternalError, `Failed to mark notification as read: ${error.message}`);
      }
  • The input schema definition for the 'mark_notification_read' tool. Defines a single required parameter `notificationId` (type: string).
    {
      name: "mark_notification_read",
      description: "Mark a specific notification as read",
      inputSchema: {
        type: "object",
        properties: {
          notificationId: { type: "string", description: "ID of notification to mark as read" }
        },
        required: ["notificationId"]
      }
    },
  • The `UserTools` class that is loaded dynamically by `ToolLoader`. The tool is registered via the `getToolDefinitions()` method (line 14) and its handler is bound in `getToolHandlers()` (line 110). The module is loaded from `src/tools/users/index.js` by `ToolLoader.loadModule()` in `src/utils/toolLoader.js`.
    export class UserTools {
      constructor() {
        this.baseUtils = baseUtils;
      }
  • The `loadModule` method in `ToolLoader` that dynamically imports the users module, instantiates `UserTools`, calls `getToolDefinitions()` and `getToolHandlers()`, and collects all tools/handlers into the global registries. This is how `mark_notification_read` gets registered with the MCP server.
    async loadModule(moduleName) {
      const modulePath = path.join(__dirname, `../tools/${moduleName}/index.js`);
      
      // Check if module file exists
      if (!fs.existsSync(modulePath)) {
        throw new Error(`Module file not found: ${modulePath}`);
      }
    
      try {
        // Dynamic import of the module
        const moduleExports = await import(`../tools/${moduleName}/index.js`);
        const ModuleClass = moduleExports.default;
        
        if (!ModuleClass) {
          throw new Error(`Module ${moduleName} does not export a default class`);
        }
    
        // Instantiate the module
        const moduleInstance = new ModuleClass();
        
        // Get tools and handlers from the module
        const toolDefinitions = moduleInstance.getToolDefinitions();
        const toolHandlers = moduleInstance.getToolHandlers();
    
        // Validate that tools and handlers match
        const toolNames = toolDefinitions.map(tool => tool.name);
        const handlerNames = Object.keys(toolHandlers);
        
        const missingHandlers = toolNames.filter(name => !handlerNames.includes(name));
        const extraHandlers = handlerNames.filter(name => !toolNames.includes(name));
        
        if (missingHandlers.length > 0) {
          console.error(`⚠️ Warning: ${moduleName} module missing handlers for tools: ${missingHandlers.join(', ')}`);
        }
        
        if (extraHandlers.length > 0) {
          console.error(`⚠️ Warning: ${moduleName} module has extra handlers: ${extraHandlers.join(', ')}`);
        }
    
        // Store module reference
        this.loadedModules.set(moduleName, {
          instance: moduleInstance,
          tools: toolDefinitions,
          handlers: toolHandlers
        });
    
        // Add to global collections
        this.allTools.push(...toolDefinitions);
        Object.assign(this.allHandlers, toolHandlers);
    
        return moduleInstance;
      } catch (error) {
        throw new Error(`Failed to load module ${moduleName}: ${error.message}`);
      }
    }
  • The `formatResponse` helper in `BaseServerUtils` that wraps text into the MCP response format (`{ content: [{ type: 'text', text }] }`). Used by the handler to produce the final return value.
    formatResponse(text) {
      return {
        content: [
          {
            type: "text",
            text: text
          }
        ]
      };
    }
Behavior2/5

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

No annotations provided. Description only states 'mark as read' without disclosing side effects, idempotency, or what happens if the notification is already read.

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?

Single sentence with no extraneous words. Efficiently communicates the core purpose.

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

Completeness3/5

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

Adequate for simple operation but lacks context on behavior with already-read notifications or integration with unread counts. With no output schema, more details would be helpful.

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 coverage is 100% and description of parameter matches. No additional meaning added beyond the schema.

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

Purpose5/5

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

The description clearly states 'Mark a specific notification as read', specifying the action and resource. It distinguishes from sibling 'mark_all_read' which marks all 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?

No guidance on when to use this tool versus alternatives like 'mark_all_read'. No context on prerequisites or constraints.

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/AI-Archive-io/MCP-server'

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