Skip to main content
Glama

query

Read-only

Search, filter, and list WhatsApp conversations, contacts, messages, transcriptions, labels, and communities, or look up items by ID across connected accounts.

Instructions

Query WhatsApp data: conversations, contacts, messages, transcriptions, labels, and communities. Supports listing, searching, filtering, and looking up by ID.

IMPORTANT: Multiple WhatsApp accounts may be connected (e.g. personal + business). Always query entity="session" FIRST to see all connected accounts and their session IDs. Then use target_session to route queries to the correct account. Each account has different conversations, contacts, and messages.

HOW TO READ MESSAGES: To get messages from a specific conversation, pass its id (e.g. "5491157390064@c.us"). This returns the conversation info WITH its messages. Use limit to control how many. Do NOT use entity="messages" for this — that is for global text search only.

AUDIO TRANSCRIPTIONS: To get audio transcriptions, use entity="transcriptions" with an optional query. Or pass a conversation id to see messages (audio messages include transcription text).

Examples: List sessions: { entity: "session" } List conversations: {} Target specific account: { entity: "conversations", target_session: "sess_abc123" } Read messages: { id: "5491157390064@c.us" } Read last 100 msgs: { id: "5491157390064@c.us", limit: 100 } Search globally: { query: "meeting" } Search in chat: { id: "5491157390064@c.us", query: "meeting" } Unread conversations: { unread: true } Search contacts: { query: "Alice", entity: "contacts" } List labels: { entity: "labels" } Filter by label: { label: "Important", entity: "conversations" } List communities: { entity: "communities" } Filter by community: { community: "My Community", entity: "conversations" } Find which groups a contact is in: { id: "5491157390064@c.us", entity: "contacts", include_participants: true } List members of a group: { entity: "contacts", group: "120363421729019499@g.us" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoLook up a specific conversation, contact, or label by ID
listNoFilter conversations by list name or ID (Personal accounts)
afterNoReturn messages after this ISO 8601 datetime (e.g. "2026-03-01T12:00:00.000Z") for incremental sync
groupNoFilter contacts by group ID — only return contacts that are members of this group
labelNoFilter conversations by label name or ID (Business accounts)
limitNoMax results (default 25, max 5000)
queryNoText to search for (names, messages, transcriptions)
beforeNoReturn messages before this ISO 8601 datetime (e.g. "2026-03-01T12:00:00.000Z") for cursor-based pagination backward
entityNoEntity type to query. Defaults to "conversations" when listing, or all when searching. Use "session" to list all connected WhatsApp accounts.
unreadNoOnly return conversations with unread messages
communityNoFilter conversations by community name or ID
exclude_mutedNoExclude muted conversations from listings (default false)
target_sessionNoSession ID to target a specific WhatsApp account. Get session IDs from entity="session". If omitted, routes to the most recently active account.
exclude_archivedNoExclude archived conversations from listings (default true)
include_participantsNoInclude group participants in results. Useful when looking up a contact by ID to see which groups they belong to, or when querying a group to see its members.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.6

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=true, so safety is covered. The description adds real behavioral context beyond that: multi-account routing semantics (omitted target_session routes to the most recently active account) and return shape ('returns the conversation info WITH its messages'). It omits rate limits and pagination behavior, keeping it short of a 5.

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-loaded with purpose, then sectioned under HOW TO READ MESSAGES, AUDIO TRANSCRIPTIONS, and Examples, which suits a 15-parameter polymorphic tool. The length is largely justified, though the example block restates some guidance already given in prose, adding mild redundancy.

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 complex, zero-required-parameter, multi-entity tool with no output schema, the description supplies the entity model, session-routing prerequisite, and worked call shapes an agent needs. It could be more complete on return structure for non-message entities and on pagination, but nothing critical to invoking it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description exceeds it by demonstrating parameter composition through worked examples that the schema cannot convey — e.g. that passing id alone returns a conversation with its messages, and how label vs list map to business vs personal accounts. This meaningfully reduces the chance of mis-combining the 15 optional parameters.

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 ('Query') and enumerates the exact resource set (conversations, contacts, messages, transcriptions, labels, communities) plus the operations supported (listing, searching, filtering, lookup by ID). It clearly distinguishes its internal modes, but it never differentiates itself from overlapping siblings such as list_contacts, get_contact, list_groups, or get_group, which an agent must resolve on its own.

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?

Offers unusually strong operational guidance: query entity="session" FIRST, then route via target_session, and an explicit exclusion ('Do NOT use entity="messages" for this — that is for global text search only'). The extensive example list shows when each mode applies. The gap is that it gives no guidance for choosing this tool over the overlapping sibling tools like list_contacts or get_group.

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