Skip to main content
Glama

List messages

list_messages
Read-onlyIdempotent

List stored WhatsApp messages newest first, filtered by chat, sender, date range, or full-text query. Supports pagination and optional neighbouring-message context for each hit.

Instructions

List stored WhatsApp messages, newest first, optionally filtered by chat, sender, date range and a full-text query (words matched by prefix, accent- and case-insensitive). Results are paginated: pass next_cursor back as cursor while has_more is true. Set include_context to get the neighbouring messages of each hit.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNoonly messages after this ISO-8601 date or datetime
limitNopage size (default 20, max 200)
queryNofull-text search; words are matched by prefix, accent- and case-insensitively
beforeNoonly messages before this ISO-8601 date or datetime
cursorNonext_cursor from the previous page
senderNoonly messages from this person: phone number, JID or contact name
chat_jidNoonly messages of this chat (JID from list_chats or search_contacts)
context_afterNomessages after each result when include_context is true (default 1)
context_beforeNomessages before each result when include_context is true (default 1)
include_contextNoattach neighbouring messages to each result (default false)

Output Schema

NameRequiredDescriptionDefault
has_moreYes
messagesYes
next_cursorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: newest-first ordering, pagination via next_cursor/has_more, full-text matching by word prefix with accent- and case-insensitive semantics, and include_context producing neighbouring messages. These are practical behavioral details an agent would not infer from the readOnly/idempotent annotations alone.

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?

Three dense, front-loaded sentences with no wasted wording. The primary purpose comes first, followed by filtering and search semantics, then pagination and context behavior.

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

Completeness5/5

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

Given ten optional parameters, a full output schema, and rich read-only annotations, the description covers the essential calling behavior: filtering, search semantics, ordering, pagination, and context expansion. Nothing critical to invoking it correctly appears to be missing.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds cross-parameter meaning not captured by individual schema descriptions, notably the cursor workflow ('pass next_cursor back as cursor while has_more is true') and the relationship between include_context and neighbouring messages.

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?

States a specific verb and resource: 'List stored WhatsApp messages'. It also establishes the default ordering ('newest first') and the filterable dimensions. It is clear, but it does not explicitly differentiate itself from siblings such as list_chats or get_message_context.

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?

Gives clear operational guidance: use filters optionally, pass next_cursor back as cursor while has_more is true, and set include_context for neighbouring messages. It provides context for how to use the tool but does not explicitly state when to prefer alternatives or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.