Skip to main content
Glama

search_messages

Search Google Chat messages across spaces by text substring or creation time. Finds messages matching query text or time range in one or multiple spaces.

Instructions

Search Chat messages across one or many spaces by text and/or time.

The Chat API does not support server-side full-text search, so this tool fetches messages per space (with optional createTime filter applied server-side) and does a case-insensitive substring match on message text client-side. For a single space list without filtering use get_messages. Requires both chat.read and contacts.readonly OAuth scopes (senders are resolved to names via People API).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYesThe user's Google email address (authenticated account).
queryNoCase-insensitive substring to match in message text. Omit to return messages by time only.
space_idNoRestrict search to one space ("spaces/<id>"). Omit to search across accessible spaces (capped by max_spaces).
page_sizeNoMax messages fetched per space. Default 25.
time_filterNoChat API createTime expression, e.g. 'createTime > "2026-03-18T00:00:00Z"' or a range joined with AND. Applied server-side.
max_spacesNoWhen space_id is omitted, cap on how many spaces are scanned. Default 10.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description fully discloses the client-side matching mechanism, server-side createTime filtering, per-space fetching, and the resolution of senders via People API. It omits mention of rate limits or pagination behavior, but the effect of page_size is described in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two short paragraphs. The first sentence captures the core purpose. Every sentence adds value: scope, mechanism, sibling reference, and auth requirements. No redundant or filler text.

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?

The tool has moderate complexity (6 parameters, client-side search across spaces) and an output schema exists. The description covers the algorithm, scope distinction, and OAuth scopes. It does not discuss error handling or what happens with no results, but the output schema likely covers return structure. Overall sufficient for effective invocation.

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?

All 6 parameters have schema descriptions (100% coverage), achieving baseline 3. The description adds value by explaining how parameters like query (case-insensitive substring) and time_filter (applied server-side) are used in the overall algorithm, and notes the max_spaces cap when space_id is omitted.

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?

The description clearly states the tool searches Chat messages by text and/or time across one or many spaces. It specifies the client-side substring matching approach and explicitly distinguishes from the sibling tool get_messages for unfiltered single-space retrieval.

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?

The description provides explicit guidance to use get_messages for a single space without filtering. It also lists required OAuth scopes. However, it does not mention when to use alternative search tools like search_gmail_messages, though that is a different domain (Gmail vs Chat).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HuntsDesk/ve-gws'

If you have feedback or need assistance with the MCP directory API, please join our Discord server