Skip to main content
Glama
mcp-whatsapp

mcp-whatsapp

get_message_context

Read-onlyIdempotent

Fetch a cached WhatsApp message with the messages before and after it, plus its quoted reply context. Works offline and read-only to inspect conversation context without side effects.

Instructions

(reads local cache; works while disconnected) Fetch a specific cached message and the surrounding messages in its chat, plus the message it replies to. Read-only; no side effects. Use list_messages to search across chats, or with chat_jid when the ID is cached in more than one conversation, which this tool reports as an error. Returns a JSON object with the target message and arrays of messages before and after it; messages carry edited: true when edited, revoked: true with revoked_at when deleted for everyone (their text and media are kept), and, for a reply, quoted_message_id, quoted_chat_jid, quoted_sender_jid and quoted_text as the reply carried them, with the cached original as quoted_message when it can be verified in the same conversation, or quoted_message_missing: true when the original is unavailable.

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": {
      "message_id": "<message_id>"
    },
    "name": "get_message_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNomessages to fetch after the target (default 5; non-positive values fall back to the default)
beforeNomessages to fetch before the target (default 5; non-positive values fall back to the default)
message_idYesWhatsApp message ID of the target message (use `message_id` from list_messages)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.0
    • addedInput schema / properties / after / description
      Added value: +"messages to fetch after the target (default 5; non-positive values fall back to the default)"
    • addedInput schema / properties / before / description
      Added value: +"messages to fetch before the target (default 5; non-positive values fall back to the default)"
    • changedInput schema / properties / message_id / description
      Previous value: -"WhatsApp message ID"New value: +"WhatsApp message ID of the target message (use `message_id` from list_messages)"
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world; the description adds real context beyond them: it reads a local cache, works while disconnected, and errors out on an ID present in multiple conversations. It also documents edit/revoke markers and how quoted messages are verified or reported missing.

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?

Front-loads the important constraint (local cache, works offline) and wastes little space. The final sentence is a long chained enumeration of return fields, which is dense but does earn its place given there is no output schema.

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?

With no output schema, the description carries the return-value burden and does so thoroughly, including edit/revoke state and quote-resolution outcomes. Coverage is complete for correct invocation; only the before/after defaults are left entirely to the schema.

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 coverage is 100%, so message_id, before and after are already fully documented in the schema, and the description adds no format or syntax detail for them. Its extra meaning is all on the return side, so the baseline of 3 applies.

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: fetches a specific cached message plus surrounding messages in its chat and the message it replies to. It is immediately distinguishable from list_messages, which it names as the search-across-chats alternative.

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?

Explicitly routes cross-chat search to list_messages and flags the ambiguous-ID case with 'chat_jid when the ID is cached in more than one conversation, which this tool reports as an error'. The phrasing is slightly tangled (chat_jid belongs to the sibling's schema, not this one), but the when-to-use split is clear and there are no unstated alternatives.

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