Skip to main content
Glama

Message context

get_message_context
Read-onlyIdempotent

Retrieve messages before and after a specific WhatsApp message to understand conversation context and surrounding replies.

Instructions

Get the messages before and after a given message in its chat.

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 include after (default 5)
beforeNomessages to include before (default 5)
chat_jidNochat of the message; recommended, ids are only unique per chat
message_idYesid of the message (from list_messages)

Output Schema

NameRequiredDescriptionDefault
afterYesmessages after the target, oldest first
beforeYesmessages before the target, oldest first
messageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and a closed world, so the safety profile is fully covered. The description adds only the framing of a bounded before/after window and does not restate or contradict those hints. It says nothing about behavior when the message id is unknown or how large a window is permitted.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though it leaves cheap-to-add context (the default window size) on the table.

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 an output schema present, full parameter documentation and complete annotations, the agent has everything needed to call the tool correctly. The only real gap is behavioral edge cases such as an invalid or missing message_id, which the description does not address.

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 before/after counts, defaults of 5, chat_jid recommendation and the message_id provenance are all documented in the schema. The description adds no meaning beyond that, which is the expected baseline when the schema already does the work.

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?

The description uses a specific verb and resource ('Get the messages before and after a given message in its chat'), making the windowed-context behavior clear and distinguishable from a plain list_messages call. It stops short of naming how it differs from siblings like list_messages, so it lands just under a 5.

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: this is the tool you call when you need surrounding conversation around a known message id. There is no explicit 'use this instead of X' guidance or stated prerequisites/exclusions, so the agent must infer the decision rule.

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