`searchExternalContent` is a typed MCP tool that searches across content synced from external connectors. The agent uses it whenever your prompt references Slack, email, or files in connected drives.
## Inputs
- **query** (required) — a substring to match - **kind** (optional) — one of `slack`, `gmail`, `outlook`, `sharepoint`, `onedrive`, `google-drive` to restrict the search to a single vendor - **limit** (optional, default 20, max 100)
## Outputs
Two arrays:
- **messages** — Slack / Gmail / Outlook hits with channel name, author, subject (when applicable), snippet, vendor URL, sent-at timestamp, and connector display name - **documents** — SharePoint / OneDrive / Drive hits with name, author, snippet (when text extracted), vendor URL, modified-at timestamp
## Search semantics today
The MVP uses ILIKE substring match on body / subject / name / text columns. Tenant-scoped — a user can only see content from connectors the workspace owner / admin authorized; revoked / paused connectors are excluded.
A future batch upgrades to: - Postgres FTS (websearch_to_tsquery + ts_rank_cd, mirroring searchKeyword over documents) - pgvector semantic similarity (embeddings already persist on both tables with HNSW cosine indexes) - Reciprocal Rank Fusion to fuse keyword + semantic across documents AND external content in one ranked list
## Permission model
Connectors are owner / admin provisioned at the tenant level. v1 design: anyone in the tenant can search authorized connector content via the agent. Per-user scope filters (e.g. "only the Slack channels I'm a member of") would require a user-token model rather than the bot-token model and are deferred.