Skip to main content
Glama

search_messages

Read-onlyIdempotent

Search messages across all conversations (individual chats and groups), or within one specific contact chat or group.

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": {
      "query": "<query>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number (default: 1)
phoneNoOptional: limit search to a specific contact's individual chat. Group messages are excluded from this scope — use group_id for groups.
queryYesSearch query to find in message text
group_idNoOptional: limit search to a specific group. Accepts the group chat_id (e.g. 120363041234567890@g.us), the id from get_groups, or the group name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and a closed-world scope, so the safety profile is covered. The description adds only the search scope; it says nothing about result ordering, result size, or how pagination behaves across a broad 'all conversations' search.

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 sentence, front-loaded with the verb and the broad scope before narrowing to the scoped case. Zero filler, though the parenthetical '(individual chats and groups)' is mildly redundant with 'across all conversations'.

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 four-parameter search tool with no output schema and a page parameter, an agent would benefit from knowing roughly what a result looks like and whether results are ordered by relevance or recency. The description is adequate given the rich annotations and full schema coverage, but it leaves that gap.

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%, and the schema itself already explains that phone excludes group messages and that group_id accepts a chat_id, an id from get_groups, or a group name. The description adds no parameter meaning beyond that, so the baseline of 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?

The description gives a specific verb ('Search') and resource ('messages'), plus the scope: all conversations, or one contact chat / group. That is clear enough to distinguish it from a plain history fetch like get_messages or get_group_messages. It stops short of naming those siblings, so the differentiation is inferential rather than explicit.

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 description implies when to use it (you have a text query and want to find matching messages) and gestures at scoping via 'within one specific contact chat or group'. However, it never states when NOT to use it or that get_messages/get_group_messages exist for retrieving conversation history instead of searching.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources