Skip to main content
Glama

Direct chat with a contact

get_direct_chat_by_contact
Read-onlyIdempotent

Retrieve a one-to-one WhatsApp chat by contact phone number, JID, or name to locate the direct conversation you need.

Instructions

Get the one-to-one chat with a contact given their phone number, JID or name.

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": {
      "contact": "<contact>"
    },
    "name": "get_direct_chat_by_contact"
  }
}

Input Schema

NameRequiredDescriptionDefault
contactYesphone number, JID or contact name

Output Schema

NameRequiredDescriptionDefault
jidYeschat JID: x@s.whatsapp.net or x@lid for a person, x@g.us for a group
nameNogroup name or contact name; empty when unknown
is_groupYes
last_messageNothe newest stored message, when requested
last_message_timeNotimestamp of the newest stored message, UTC

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds only that lookup is one-to-one and keyed by contact, without noting name-resolution collisions or failure behavior for unknown contacts.

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?

One compact sentence, front-loaded with the verb and resource. No filler, though it is slightly under-specified for its brevity.

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?

Output schema exists, so return values need no explanation, and the tool is simple. Still missing is disambiguation behavior for name lookups and guidance relative to the many chat-retrieval siblings.

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% and the single parameter is fully documented, so baseline is 3. The description restates the accepted identifier forms (phone, JID, name) but adds no format or precedence rules beyond the schema.

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+resource ('Get the one-to-one chat with a contact') and names the three identifier forms accepted. Clearly distinguishable from siblings like get_chat or get_contact_chats.

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

Usage Guidelines2/5

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

No guidance on when to use this versus get_chat, get_contact_chats, or list_chats, nor what happens with ambiguous names or missing contacts. The identifier forms are the only selection hint.

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