Skip to main content
Glama
Jem-HR
by Jem-HR

mark_message_as_read

Update WhatsApp message status to read by providing the message ID, helping manage conversation flow and track message delivery status.

Instructions

Mark a message as read.

Args: message_id: The WhatsApp message ID to mark as read sender: Optional phone ID

Returns: Dictionary with success status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYes
senderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for mark_message_as_read tool. Decorated with @mcp.tool() for registration, it accepts message_id (required) and sender (optional) parameters, calls wa_client.mark_message_as_read() to perform the actual WhatsApp API call, and returns a success/error response with logging.
    @mcp.tool()
    async def mark_message_as_read(
        message_id: str,
        *,
        sender: Optional[str] = None,
    ) -> dict:
        """
        Mark a message as read.
        
        Args:
            message_id: The WhatsApp message ID to mark as read
            sender: Optional phone ID
        
        Returns:
            Dictionary with success status
        """
        try:
            result = wa_client.mark_message_as_read(
                message_id=message_id,
                sender=sender,
            )
            
            logger.info(f"Message {message_id} marked as read")
            result_data = str(result) if result else None
            return {"success": True, "result": result_data}
        except Exception as e:
            logger.error(f"Failed to mark message as read: {str(e)}")
            return {"success": False, "error": str(e)}
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Mark a message as read') but doesn't explain what this entails (e.g., whether it updates message status in a database, triggers notifications, or requires specific authentication). It also omits details like error conditions, rate limits, or side effects, which are critical for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by parameter and return value sections. It avoids unnecessary fluff, but the parameter descriptions could be more informative (e.g., explaining 'sender' usage) without adding bulk, keeping it efficient overall.

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?

Given the tool's moderate complexity (2 parameters, mutation action) and lack of annotations, the description is minimally adequate. It covers the basic action and parameters but misses behavioral context (e.g., permissions, effects). The presence of an output schema helps by documenting the return value, but overall completeness is limited for safe tool invocation.

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 0%, so the description must compensate. It documents both parameters ('message_id' and 'sender') and provides basic semantics (e.g., 'message_id' identifies the message, 'sender' is optional). However, it lacks details like format requirements (e.g., WhatsApp message ID structure) or when 'sender' is needed, leaving gaps that the schema doesn't fill.

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 tool's purpose with a specific verb ('Mark') and resource ('a message as read'), making it immediately understandable. However, it doesn't explicitly differentiate this tool from potential sibling tools like 'send_reaction' or 'remove_reaction' that might also interact with message status, though the purpose is distinct enough to avoid confusion.

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., message must exist, user must have permissions) or compare it to related tools like 'send_reaction' for other message interactions. The lack of context leaves the agent to infer usage scenarios independently.

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/Jem-HR/pywa-mcp-server'

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