Skip to main content
Glama
matthewdtowles

iwantmymtg-mcp

mark_all_notifications_read

Clears all unread notifications for the authenticated user, removing all alerts at once.

Instructions

Mark every notification for the authenticated user as read. Requires IWMM_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'mark_all_notifications_read' - calls apiFetch with PATCH method on /api/v1/notifications/read-all. This is both the handler and the schema definition (inline).
    export const markAllNotificationsReadTool = {
      name: "mark_all_notifications_read",
      description: "Mark every notification for the authenticated user as read. Requires IWMM_API_KEY.",
      inputSchema: z.object({}),
      handler: () => apiFetch({ path: "/api/v1/notifications/read-all", method: "PATCH", authenticated: true }),
    };
  • Input schema is z.object({}) (no arguments required), defined inline in the tool definition object.
    export const markAllNotificationsReadTool = {
      name: "mark_all_notifications_read",
      description: "Mark every notification for the authenticated user as read. Requires IWMM_API_KEY.",
      inputSchema: z.object({}),
      handler: () => apiFetch({ path: "/api/v1/notifications/read-all", method: "PATCH", authenticated: true }),
    };
  • The tool is imported from notifications.ts and added to the tools array at line 87, making it available for registration.
    markAllNotificationsReadTool,
  • Import of markAllNotificationsReadTool from notifications.ts at line 38.
    import {
      listNotificationsTool,
      getUnreadCountTool,
      markNotificationReadTool,
      markAllNotificationsReadTool,
    } from "./notifications.js";
  • The apiFetch helper function used by the handler to make the authenticated PATCH request to the API.
    export async function apiFetch<T = unknown>(req: ApiRequest): Promise<T> {
      const url = new URL(req.path, config.baseUrl);
      if (req.query) {
        for (const [k, v] of Object.entries(req.query)) {
          if (v !== undefined && v !== null && v !== "") {
            url.searchParams.set(k, String(v));
          }
        }
      }
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "iwantmymtg-mcp/0.0.1",
      };
    
      if (req.authenticated) {
        const { requireApiKey } = await import("./config.js");
        headers["Authorization"] = `Bearer ${requireApiKey()}`;
      }
    
      if (req.body !== undefined) {
        headers["Content-Type"] = "application/json";
      }
    
      const res = await fetch(url, {
        method: req.method ?? "GET",
        headers,
        body: req.body !== undefined ? JSON.stringify(req.body) : undefined,
      });
    
      if (!res.ok) {
        const text = await res.text();
        throw new ApiError(res.status, text, {
          limit: res.headers.get("X-RateLimit-Limit") ?? undefined,
          remaining: res.headers.get("X-RateLimit-Remaining") ?? undefined,
          reset: res.headers.get("X-RateLimit-Reset") ?? undefined,
        });
      }
    
      if (res.status === 204) return undefined as T;
      return (await res.json()) as T;
    }
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses it's a mutation affecting all notifications, but doesn't mention potential side effects (e.g., no undo, no rate limits) or whether it updates unread counts.

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?

Two short sentences, clear and direct. No wasted words.

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

Completeness4/5

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

For a simple action with no output schema and no annotations, the description covers the purpose and a prerequisite. It is sufficient but could mention the effect on unread count.

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

Parameters4/5

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

There are no parameters, so the description doesn't need to add parameter info. Baseline 4 is appropriate as the schema already covers all parameters.

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 that it marks all notifications as read for the user, using a specific verb and resource. It differentiates from the sibling tool 'mark_notification_read' by implying a bulk operation.

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

Usage Guidelines4/5

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

It mentions the required API key ('Requires IWMM_API_KEY'), providing clear context. However, it doesn't explicitly contrast with 'mark_notification_read' or indicate when to use this tool over alternatives.

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/matthewdtowles/iwantmymtg-mcp'

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