Skip to main content
Glama
mcp-whatsapp

mcp-whatsapp

get_message_context

Read-onlyIdempotent

Fetch a cached WhatsApp message plus the messages before and after it in the same chat, so you can read surrounding conversation context while offline.

Instructions

(reads local cache; works while disconnected) Fetch a specific cached message and the surrounding messages in its chat. Read-only; no side effects. Use list_messages for searching across many chats. Returns a JSON object with the target message and arrays of messages before and after it; messages carry edited: true when edited, and revoked: true with revoked_at when deleted for everyone (their text and media are kept).

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.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new context: it reads a local cache and works while disconnected, and it explains the edited/revoked flags including that revoked text and media are retained. This is behavioral detail the annotations cannot convey.

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 cache/disconnected caveat and the read-only guarantee, then the alternative, then the return shape. Dense with semicolons but every clause carries information; no filler.

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?

No output schema exists, yet the description explains the return object (target message plus before/after arrays) and the edited/revoked semantics. Combined with full schema coverage and annotations, an agent has everything needed to call it 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 coverage is 100%, so before/after defaults and the message_id source are already documented in the schema. The description adds no parameter-level detail beyond that, so the baseline 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 ('Fetch a specific cached message and the surrounding messages in its chat') and explicitly contrasts with the sibling list_messages. An agent can distinguish it from list_messages, get_chat, and search tools without opening any schema.

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 a clear routing rule: use list_messages for searching across many chats, implying this tool is for targeted context retrieval around a known message_id. It lacks an explicit 'when not to use' or prerequisite statement, but the alternative is named concretely.

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