Skip to main content
Glama

search_messages

Read-onlyIdempotent

Search message content across all chats — semantic + keyword. Use to find what was said: quotes, topics, info exchanged. Pass direction, chat_kind or per_chat for an EXACT text search instead: who wrote it (outgoing = the owner), private chats or groups, one result per chat with the number of matches. That is the way to find the chat of a person by how the owner addresses them, e.g. query='Дима', direction='outgoing', chat_kind='dm', per_chat=true. For chats/threads themselves use search.threads; for files use search.files; for links use search.links.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum messages to return.
queryNoWhat to search for in message content.
date_toNoISO8601 date (YYYY-MM-DD) upper bound. OMIT to skip.
per_chatNoExact search only: one result per chat (its newest match) with `matches` = how many messages there matched. OMIT for every message.
chat_kindNoExact search only: 'dm' = private chats, 'group' = groups and channels. OMIT for both.
date_fromNoISO8601 date (YYYY-MM-DD) lower bound. OMIT to skip.
directionNoExact search only: 'outgoing' = messages the owner wrote, 'incoming' = messages others wrote. OMIT for both.
whole_wordNoExact search only: match the query as a whole word ('Дима' finds 'Привет, Дима!' but not 'Димасик'). OMIT to match any part of a word.
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
participant_nameNoFilter to messages involving this participant/contact name. OMIT to search across everyone (do NOT pass an empty string).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / chat_kind
      Added value: +{
      +  "description": "Exact search only: 'dm' = private chats, 'group' = groups and channels. OMIT for both.",
      +  "enum": [
      +    "dm",
      +    "group"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / direction
      Added value: +{
      +  "description": "Exact search only: 'outgoing' = messages the owner wrote, 'incoming' = messages others wrote. OMIT for both.",
      +  "enum": [
      +    "outgoing",
      +    "incoming"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / per_chat
      Added value: +{
      +  "description": "Exact search only: one result per chat (its newest match) with `matches` = how many messages there matched. OMIT for every message.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / whole_word
      Added value: +{
      +  "description": "Exact search only: match the query as a whole word ('Дима' finds 'Привет, Дима!' but not 'Димасик'). OMIT to match any part of a word.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  3. Added
  4. Removed
  5. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources