search_messages_raw
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 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. | |
| query | Yes | Connector-native query, e.g. Gmail: "from:tanaka is:unread newer_than:7d has:attachment". | |
| cursor | No | Opaque next_cursor from the preceding page. Keep connector, query, accounts, limit and filters unchanged. Expires after 15 minutes. | |
| filters | No | Gmail/Slack shared filters; unsupported conditions return explicit errors. Messenger does not support these filters. after/before are timezone-qualified ISO instants. | |
| accounts | No | Limit to these account labels (see list_accounts). Omit to search all accounts for the connector. | |
| connector | Yes | Connector to search. Its native query syntax applies. |