Skip to main content
Glama

search_messages

Read-only

Smart search of the user's connected message sources (Gmail, Slack, and Facebook Messenger today; more later). Give a natural-language intent; we compile the query, search all connected accounts, retry with different wording if nothing matches, and return only the messages relevant to the intent, plus trials (each query tried + hit count) and note (what was excluded). Slack requires a workspace connected with search:read (older connections must reconnect; they're skipped automatically). Use search_messages_raw instead if you want to run an exact connector query yourself. Each errors[] entry carries kind: 'reconnect' = that account's connection is broken or lacks a permission (tell the user to reconnect it under 設定 → サービス連携); 'accounthub_unavailable' = AccountHub itself is down — show the error text (it asks the user to contact the service provider); reconnecting will not help, so never suggest reconnecting; 'provider_unavailable' = Slack/Google itself may be having an outage (not the user's connection, not AccountHub) — show the error text with its status-page link and retry later; 'transient' = rate limit, wait and retry. Only 'reconnect' means reconnecting helps. 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesNatural-language search intent, e.g. "先週の田中さんからの未読メール".
accountsNoLimit to these account labels (see list_accounts). Omit to search all accounts.
connectorsNoLimit to these connectors. Omit to search all connected + readable ones.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / connectors / items / enum
      Previous value: -[
      -  "gmail",
      -  "slack",
      -  "messenger"
      -]New value: +[
      +  "gmail",
      +  "slack",
      +  "messenger",
      +  "chatwork"
      +]
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the `readOnlyHint` annotation, the description discloses query compilation, automatic retries with rephrasing, returned `trials`, `note`, and `coverage`, and a detailed error taxonomy distinguishing reconnect, AccountHub outage, provider outage, and transient failures. It also explains Slack reconnection behavior and Chatwork scan limits.

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

Conciseness4/5

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

The purpose and alternative are front-loaded, and most sentences carry non-redundant operational information. However, the definition is dense and long, with error-handling details that could be structured more cleanly and some repetition around when reconnecting helps.

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 complex multi-connector search tool with no output schema, the description is highly complete: it explains return fields, error kinds, connector-specific limitations, authentication requirements, and fallback behavior. An agent has enough context to invoke it correctly and interpret the main outcomes.

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 schema already documents `text`, `accounts`, and `connectors`. The description adds useful connector-specific semantics that affect parameter choice, especially Slack permission requirements and Chatwork's limited scanning, though it does not add further meaning for the `accounts` parameter beyond 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?

The description states a specific action: natural-language search across connected message sources, returning relevant messages plus trials and note. It also explicitly distinguishes itself from `search_messages_raw` for exact connector queries, so an agent can identify the tool without opening the 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?

It names the alternative `search_messages_raw` and the condition that selects it: exact connector queries. It also gives connector-specific usage constraints, including Slack `search:read` requirements and Chatwork's limitation to the latest 100 messages per recent room.

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