Skip to main content
Glama

waha_mark_chat_read

Mark WhatsApp chat messages as read by specifying chat ID, number of recent messages, or time range in days.

Instructions

Mark messages in a chat as read. Can specify number of recent messages or time range in days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID to mark as read (format: number@c.us)
messagesNoNumber of recent messages to mark as read (default: 30)
daysNoMark messages from last N days as read (default: 7)

Implementation Reference

  • MCP tool handler function that extracts parameters, validates chatId, calls WAHAClient.markChatAsRead, and returns formatted success response.
    private async handleMarkChatRead(args: any) {
      const chatId = args.chatId;
      const messages = args.messages || 30;
      const days = args.days || 7;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      await this.wahaClient.markChatAsRead({
        chatId,
        messages,
        days,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully marked messages as read in chat ${chatId}.\nMessages: ${messages}\nDays: ${days}`,
          },
        ],
      };
    }
  • src/index.ts:143-164 (registration)
    Tool registration in ListToolsRequestHandler including name, description, and input schema definition.
    name: "waha_mark_chat_read",
    description: "Mark messages in a chat as read. Can specify number of recent messages or time range in days.",
    inputSchema: {
      type: "object",
      properties: {
        chatId: {
          type: "string",
          description: "Chat ID to mark as read (format: number@c.us)",
        },
        messages: {
          type: "number",
          description: "Number of recent messages to mark as read (default: 30)",
          default: 30,
        },
        days: {
          type: "number",
          description: "Mark messages from last N days as read (default: 7)",
          default: 7,
        },
      },
      required: ["chatId"],
    },
  • WAHAClient helper method that makes POST request to WAHA API endpoint to mark specified number of recent messages or messages from last N days as read.
    async markChatAsRead(params: MarkChatAsReadParams): Promise<void> {
      const { chatId, messages = 30, days = 7 } = params;
    
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const queryParams = {
        messages,
        days,
      };
    
      const queryString = this.buildQueryString(queryParams);
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(
        chatId
      )}/messages/read${queryString}`;
    
      await this.request<void>(endpoint, {
        method: "POST",
      });
    }
  • TypeScript interface defining input parameters for markChatAsRead: chatId (required), optional messages count and days.
    export interface MarkChatAsReadParams {
      chatId: ChatId;
      messages?: number;
      days?: number;
    }
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 tool's action but doesn't mention whether this operation requires specific permissions, if it's reversible, what happens to unread counts, or any side effects. For a mutation tool with zero annotation coverage, this leaves significant behavioral 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 perfectly concise with two sentences that directly convey the tool's purpose and parameter options. Every word earns its place, and the information is front-loaded with the core action stated first.

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?

For a mutation tool with no annotations and no output schema, the description provides basic purpose but lacks important context about behavioral implications, error conditions, or what constitutes success. While the schema covers parameters well, the overall context for safe and effective use is incomplete.

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%, providing complete parameter documentation. The description adds marginal value by mentioning the two optional parameters ('number of recent messages' and 'time range in days'), but doesn't provide additional semantic context beyond what's already in the schema descriptions. Baseline 3 is appropriate when schema does the heavy lifting.

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 messages in a chat as read') and specifies the resource ('chat'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'waha_mark_chat_unread' by specifying the opposite action, though it doesn't explicitly mention this distinction in the description text itself.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'number of recent messages or time range in days', suggesting when to apply different parameters. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'waha_mark_chat_unread' or clarify prerequisites beyond the required chatId parameter.

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/seejux/waha-whatsapp-mcp'

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