Skip to main content
Glama
WhatsApp MCP Server

WhatsApp MCP Server

get_message_context

Fetch the surrounding conversation for a specific WhatsApp message, returning the target message plus preceding and succeeding messages in chronological order.

Instructions

Retrieve the conversational context around a specific message. Returns the target message along with preceding and succeeding messages in chronological order.

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
afterNoNumber of succeeding messages to fetch (default 5, max 50).
beforeNoNumber of preceding messages to fetch (default 5, max 50).
message_idYesInternal message primary key (Z_PK) or unique WhatsApp stanza ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/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. It does disclose the return shape and chronological ordering, which is genuinely useful, but says nothing about behavior at conversation boundaries (message at start/end of thread), whether results cross chat boundaries, or permission/access requirements.

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?

Two sentences, front-loaded with the purpose and followed by the return shape. No filler, no restatement of the tool name, nothing that could be trimmed.

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?

For a simple three-parameter read tool with full schema coverage and no output schema, the description covers purpose and return contents adequately. The remaining gap is edge-case behavior around thread boundaries, which is minor for this complexity level.

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%, with before/after defaults, min/max, and message_id accepted formats all documented in the schema. The description adds no parameter-level meaning 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Retrieve the conversational context around a specific message') and goes further by describing what comes back: the target message plus preceding and succeeding messages. It doesn't explicitly differentiate itself from siblings like list_messages or search_messages, but the 'around a specific message' framing makes the distinction reasonably clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: an agent can infer this is for when you already have a message ID and need surrounding conversation. There is no explicit when-not guidance or named alternative (e.g., use list_messages for a whole chat, search_messages to locate a message first), leaving the routing decision to inference.

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