Skip to main content
Glama

get_message_context

Fetches surrounding messages before and after a given chat message ID so agents can reply with accurate context.

Instructions

Window of messages around one message id (before/after), for replying in context.

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

Input Schema

NameRequiredDescriptionDefault
chatYesChat: phone number like +911234567890, or a JID (…@s.whatsapp.net, …@g.us).
afterNoMessages after it (0-50).
beforeNoMessages before it (0-50).
message_idYesMessage id to centre on.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and it largely does not. It never states that this is a read-only operation, whether messages are returned in chronological order, what happens if the anchor id is missing or the chat scope mismatches, or how the window is truncated at the start/end of the chat.

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 dense sentence with the resource and anchor front-loaded and no filler. It is slightly telegraphic, mixing the 'window' concept with the use case in one clause, but every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple four-parameter read tool with rich schema coverage and no output schema, the description covers the core idea adequately. It still leaves the agent guessing about result ordering and edge-case behavior at the start or end of a chat, which matters for the stated 'replying in context' use case.

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 all four parameters, including the 0-50 bounds and defaults for before/after, are already documented structurally. The description only restates 'before/after' and 'message id' without adding interpretation such as how the window behaves at chat boundaries.

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 names a specific resource ('window of messages') and the anchor it is relative to ('around one message id'), plus the two directional parameters. It is clearly distinguishable from bulk reads like get_messages, though it never names a sibling to sharpen the contrast.

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?

The trailing clause 'for replying in context' implies a use case, which is better than nothing. However, there is no explicit when-to-use vs. when-not guidance and no named alternative (e.g., get_messages or search_messages) for the case where no anchor message id exists.

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