search_messages
Find past messages and decisions by ranked full-text query across channel history, with boolean and phrase syntax plus role/kind/status filters.
Instructions
Full-text search across the whole channel history (topic + body), best match first with a highlighted snippet. This is the tool for 'what did we decide about X' / 'where did merchant_id come up' — list_messages(text=...) is an unranked substring filter, this one ranks and understands query syntax: bare words are AND-ed, "quoted phrases" match literally, OR / NOT combine terms. Matching is SUBSTRING-based (trigram index), so no word-boundary or morphology traps: on Russian text 'ротаци' finds 'ротация', 'ротаций' and 'ротациями' alike, and exact markers ('merchant_id', '=== НАЧАЛО ТЕЛА ===') are matched literally rather than split into 'similar' words. Terms shorter than 3 characters cannot use the index and are answered by a plain scan instead — each hit says which path found it in 'match' (fts | substring). Optional from_role/to_role/kind/status narrow the result set. Soft-deleted messages are excluded. Optional 'fields' projects the response: a list of field names, or the single value 'headers' for the usual listing set (everything except the bodies). Omit it and the full record comes back exactly as before. Use it when a listing over a long history would otherwise be too large to return — bodies dominate the size, and a 'which messages' question rarely needs them; fetch the ones you want individually afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| limit | No | ||
| query | Yes | ||
| fields | No | ||
| status | No | ||
| to_role | No | ||
| from_role | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||