Skip to main content
Glama

search_messages_raw

Read-only

Run a Gmail, Slack or Messenger query in that connector's own syntax across ALL of the user's accounts for that connector (or a subset via accounts) and return normalized messages (no relevance filtering). Bare Slack channel IDs in in:/-in: are normalized to Slack's <#ID> syntax. Gmail supports the full operator set: from: to: cc: subject: has:attachment filename: is:unread/read/starred/important label: after:/before:/newer_than:/older_than: larger:/smaller: — and in:anywhere to include spam & trash (excluded by default). messenger = space-separated keywords, AND semantics over recent messages. slack = Slack search syntax: plain keywords + from:@name in:#channel or in:<#CHANNEL_ID> after:/before:/during:YYYY-MM-DD has:link (no relative window like newer_than — use after: with a date). One hit per MESSAGE; external_id is 'channel_id:ts' (pass it to send_message's reply_to_external_id to reply in-thread). Requires a workspace connected with search:read — workspaces without it are reported in errors with a reconnect hint. Each Gmail hit is ONE THREAD, represented by its newest matching message (not the thread's oldest message), deduplicated within each page; a thread may recur on later pages. limit is the provider page size per account (default 30, max 100). Follow pagination.next_cursor with identical inputs until has_more is false. Empty filtered pages can have a continuation. Gmail totals estimate matching messages, not unique threads. Pagination and common filters are supported for Gmail and Slack only; Messenger retains its keyword-only recent-message search, nonempty query and 50-per-account maximum, without continuation. Exhaustion never implies complete historical coverage. Call list_accounts first to learn valid account labels. Returned messages include account, subject, sender, snippet, body, url and message_at (ISO). Recipient, cc, labels, has_attachments and is_unread are source-specific and may be absent. The response also carries per-account errors and pagination.accounts with totals (exact/estimate/unknown), coverage notes and unsupported filters. Common filters are combined with the native query. unread is Gmail-only; dm is Slack DM/MPDM; mention is a direct Slack mention of the connected user (not user-group/channel mentions). after is inclusive and before exclusive ISO timestamps with timezone. Unsupported filters fail per account instead of being ignored. Use this when you want to drive the query and judge results yourself; use search_messages to have us build and curate. Chatwork has no search API: it scans only the latest 100 messages of each of the most recently active rooms (default 10, max 30), by keyword substring (space-separated = AND) — older messages are NOT found and there is no time-range filter. coverage in the result says exactly what was scanned. For connector="chatwork" the query is plain keywords (space-separated = AND).

Input Schema

NameRequiredDescriptionDefault
limitNoProvider page size PER account (default 30; Gmail/Slack max 100, Messenger max 50). Follow next_cursor for more; filtering/dedup can produce fewer results.
queryYesConnector-native query, e.g. Gmail: "from:tanaka is:unread newer_than:7d has:attachment".
cursorNoOpaque next_cursor from the preceding page. Keep connector, query, accounts, limit and filters unchanged. Expires after 15 minutes.
filtersNoGmail/Slack shared filters; unsupported conditions return explicit errors. Messenger does not support these filters. after/before are timezone-qualified ISO instants.
accountsNoLimit to these account labels (see list_accounts). Omit to search all accounts for the connector.
connectorYesConnector to search. Its native query syntax applies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor from the preceding page. Keep connector, query, accounts, limit and filters unchanged. Expires after 15 minutes.",
      +  "maxLength": 65536,
      +  "type": "string"
      +}
    • addedInput schema / properties / filters
      Added value: +{
      +  "description": "Gmail/Slack shared filters; unsupported conditions return explicit errors. Messenger does not support these filters. after/before are timezone-qualified ISO instants.",
      +  "properties": {
      +    "after": {
      +      "type": "string"
      +    },
      +    "before": {
      +      "type": "string"
      +    },
      +    "dm": {
      +      "type": "boolean"
      +    },
      +    "mention": {
      +      "type": "boolean"
      +    },
      +    "unread": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Max threads/messages to return PER account (default 30, all connectors). Raise it when the user wants an exhaustive list."New value: +"Provider page size PER account (default 30; Gmail/Slack max 100, Messenger max 50). Follow next_cursor for more; filtering/dedup can produce fewer results."
    • changedInput schema / properties / limit / maximum
      Previous value: -50New value: +100
    • removedInput schema / properties / query / minLength
      Removed value: -1
  2. Changed1 schema field changed
    • changedInput schema / properties / connector / enum
      Previous value: -[
      -  "gmail",
      -  "slack",
      -  "messenger"
      -]New value: +[
      +  "gmail",
      +  "slack",
      +  "messenger",
      +  "chatwork"
      +]
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The readOnlyHint annotation only covers safety; the description adds far more: per-account `errors` with reconnect hints, unsupported filters failing per account rather than being silently ignored, `limit` being a per-account page size, Gmail hits being one THREAD represented by its newest matching message with possible recurrence across pages, dedup within pages, empty filtered pages still carrying a cursor, and 'exhaustion never implies complete historical coverage'. These are non-obvious traits an agent could not infer from annotations or schema.

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

Conciseness3/5

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

Nearly every sentence carries real information, and the most important contrast (raw vs. `search_messages`) is front-loaded in the first and near-last sentences. However, it is a single ~450-word run-on block mixing Gmail syntax, Slack syntax, pagination semantics, filter semantics and Chatwork caveats with no paragraphing or bullets, making it hard to scan for the one fact an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter multi-connector search with no output schema, this covers what an agent needs: required scope, account discovery, per-connector query syntax, pagination loop instructions, and even the returned fields ('account, subject, sender, snippet, body, url and message_at') plus the fact that recipient/cc/labels/has_attachments/is_unread are source-specific and may be absent. Little an agent needs to call 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 goes beyond it by explaining the meaning of the shared `filters` object, which the schema leaves largely undocumented: `unread` is Gmail-only, `dm` means Slack DM/MPDM, `mention` is a direct Slack mention of the connected user (not user-group/channel mentions), `after` is inclusive and `before` exclusive ISO instants, and common filters are ANDed with the native query. It also warns cursor reuse requires identical inputs (though expiry time is already in 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?

Opens with a specific verb and resource: 'Run a Gmail, Slack or Messenger query in that connector's own syntax across ALL of the user's accounts ... and return normalized messages (no relevance filtering).' It states scope (all accounts, or a subset via `accounts`) and explicitly contrasts itself with the sibling `search_messages` (curated variant), so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit selection rule: 'Use this when you want to drive the query and judge results yourself; use `search_messages` to have us build and curate.' It also names prerequisites ('Call list_accounts first to learn valid account labels', 'Requires a workspace connected with search:read') and per-connector limits/what is not supported (Messenger has no pagination/filters, Chatwork has no search API at all).

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