Skip to main content
Glama

Perisclaw: Use ChatGPT and Claude with your WhatsApp

Get Messages

get_messages
Read-only

Read recent messages from ONE chat, MOST RECENT FIRST. Returns sender (JID), canonical sender_identity / @sender_mention (including for LID group senders), from_me, body, type, attachment filename/mimetype, timestamp, reactions, and any quoted message. Messages deleted for everyone read "This message was deleted" with type revoked and their original text in prev_body. Empty / system / undecryptable rows are skipped, so this is the clean way to read or summarise a conversation. Page to older messages with before.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chat_id": "<chat_id>"
    },
    "name": "get_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax messages to return. Default 30, max 100.
beforeNoOptional upper bound — return messages older than this instant, to page backwards. ISO 8601 (e.g. "2026-06-16T09:30:00Z"); epoch-ms also accepted.
chat_idYesThe chat JID to read (DM or group).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), and the description adds substantial context beyond them: the exact returned fields, how revoked messages surface ('This message was deleted' with type `revoked` and `prev_body`), and that empty/system/undecryptable rows are filtered out. That filtering behavior is exactly the kind of non-obvious trait an agent needs and cannot infer from annotations.

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?

Front-loaded with the core action and ordering, then return shape, then special-case semantics (revoked rows, skipped rows), then pagination. Nearly every clause carries operational information; no filler or restated title.

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?

There is no output schema, so the description compensates by enumerating the return fields and explaining the deleted-message representation and row filtering. For a three-parameter read tool this covers everything an agent needs to call it and interpret results correctly.

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%, so limit, before, and chat_id are already documented with types, defaults, max, and formats. The description only reinforces `before` for backward paging and does not add syntax or edge-case guidance (e.g., behavior when `before` predates the chat start) beyond the schema. Baseline 3 is appropriate.

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?

States a specific verb and resource ('Read recent messages from ONE chat') plus ordering ('MOST RECENT FIRST') and scoping emphasis on 'ONE' chat. This clearly separates it from plural/aggregate siblings like chats_recent and from search_messages, which would be query-driven rather than chat-scoped.

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?

Frames the tool's role well ('this is the clean way to read or summarise a conversation') and gives the paging instruction ('Page to older messages with `before`'). It stops short of explicitly naming an alternative for keyword lookup (e.g., search_messages) or stating when not to use it, so it does not reach the 5 level.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.