You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/chat.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,15 @@ The MCP server exposes the following tools to connected AI clients:
47
47
48
48
| Tool | Description | Parameters |
49
49
|---|---|---|
50
-
|`search_messages`| Search with Gmail-like query syntax. When [vector search](/usage/vector-search/) is configured, supports semantic and hybrid modes. |`query` (string, required), `mode` (string: `fts`/`vector`/`hybrid`, default `fts`), `explain` (bool), `limit` (int), `offset` (int), `account` (string) |
50
+
|`search_messages`| Search with a subset of Gmail query syntax (not full Gmail compatibility). When [vector search](/usage/vector-search/) is configured, supports semantic and hybrid modes. |`query` (string, required), `mode` (string: `fts`/`vector`/`hybrid`, default `fts`), `explain` (bool), `limit` (int), `offset` (int), `account` (string) |
51
51
|`find_similar_messages`| Nearest-neighbor search from a seed message's embedding. Requires vector search to be configured and an active index generation. |`message_id` (int, required), `limit` (int), `account` (string), `after` (string), `before` (string), `has_attachment` (bool) |
52
52
|`search_by_domains`| Find messages where any participant (`from`, `to`, or `cc`) belongs to one of several domains, regardless of direction. |`domains` (comma-separated string, required), `limit` (int), `offset` (int), `after` (string), `before` (string) |
53
53
|`get_message`| Get full message details by ID |`id` (int) |
`search_messages` and `list_messages` return paginated JSON:
@@ -76,6 +76,29 @@ backend cannot report a full result count, `total` is `-1`; use
76
76
`has_more` as the pagination signal. `list_messages` uses this
77
77
`total = -1` shape because it does not run a separate count query.
78
78
79
+
### `search_messages` query syntax
80
+
81
+
Supported operators: `from:`, `to:`, `cc:`, `bcc:`, `subject:`, `label:` (or `l:`), `has:attachment`, `before:`/`after:` (YYYY-MM-DD), `older_than:`/`newer_than:` (e.g. `7d`, `2w`, `1m`, `1y`), `larger:`/`smaller:` (e.g. `5M`). Bare domains on `from:`/`to:` match any address at that domain. Multiple terms are ANDed.
82
+
83
+
Not supported: negation (`-has:attachment`), `OR`, or parentheses grouping.
84
+
85
+
Free text matches subject, snippet, and sender fields first. If that returns no results, the server falls back to full-text search including message bodies (when the FTS index is available).
86
+
87
+
### `aggregate` response
88
+
89
+
`group_by=time` buckets messages by **calendar year** only. Each row's `Key` is a year string (e.g. `"2024"`). Month or day granularity is not available via MCP.
90
+
91
+
All `group_by` values return a JSON array of objects with these fields:
92
+
93
+
| Field | Description |
94
+
|---|---|
95
+
|`Key`| Grouping value (email, domain, label name, or year) |
96
+
|`Count`| Number of messages in the group |
97
+
|`TotalSize`| Sum of `size_estimate` in bytes |
98
+
|`AttachmentSize`| Sum of attachment sizes in bytes |
99
+
|`AttachmentCount`| Number of attachments |
100
+
|`TotalUnique`| Total number of distinct groups (same on every row) |
101
+
79
102
`find_similar_messages` is only registered when the server starts with vector search configured. `search_messages` is always available, but `mode=vector` and `mode=hybrid` return `vector_not_enabled` when the server is not configured for vector search. Vector and hybrid queries require at least one free-text term (operator-only queries return `missing_free_text`). They support `offset`/`limit` pagination inside the configured hybrid ranking window; when `[vector.search].max_page_size_hybrid` is positive, an `offset` at or beyond that cap returns `pagination_limit`. Use `mode=fts` for deeper pagination or adjust that config cap.
80
103
81
104
In `mode=vector` and `mode=hybrid`, the paginated response also includes
mcp.Description("Gmail-style search query (e.g. 'from:alice subject:meeting after:2024-01-01'); mode=vector|hybrid require at least one free-text term"),
242
+
mcp.Description(queryDesc+"; mode=vector|hybrid require at least one free-text term"),
0 commit comments