Skip to main content
Glama

Slack Search Messages

slack_search_messages
Read-only

Searches Slack messages. Optionally restrict to a specific channel_id. A hit whose text is the marker "[body not included in this search result]" (with body_missing: true) DID match — its body was lost by the reader, not empty. Read it with slack_read_channel_messages on its channel_id; never report it to the user as an empty message. Direct messages come back as an unresolved id rather than a name; slack_list_channels maps ids to names.

Input Schema

NameRequiredDescriptionDefault
limitNoMax results to return (default 50)
queryYesSearch text. Slack 4.50+ runs Slack's own search, as its search box does: it matches words, not a substring, so quote a phrase ("like this") to find it exactly. An older Slack is searched in its local cache as a case-insensitive substring.
channel_idNoOptional channel ID to restrict search

Output Schema

NameRequiredDescriptionDefault
noteNoPresent when something about the answer needs stating: bodies that did not survive the reader, unresolved channel names, or a genuine zero
countYesNumber of results returned
resultsYesMatching messages, most recent first

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Search text (case-insensitive substring match)"New value: +"Search text. Slack 4.50+ runs Slack's own search, as its search box does: it matches words, not a substring, so quote a phrase (\"like this\") to find it exactly. An older Slack is searched in its local cache as a case-insensitive substring."
  2. Changed5 schema fields changed
    • addedOutput schema / properties / note
      Added value: +{
      +  "description": "Present when something about the answer needs stating: bodies that did not survive the reader, unresolved channel names, or a genuine zero",
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / body_missing
      Added value: +{
      +  "description": "True when the match's text did not survive the reader — the message exists and matched; see `note`",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / results / items / properties / channel_name_unresolved
      Added value: +{
      +  "description": "True when the channel could not be resolved to a readable name",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / results / items / properties / text / description
      Previous value: -"Message text (truncated to 500 chars)"New value: +"Message text (truncated to 500 chars), or an explicit marker when the body is missing — never a silent empty string"
    • addedOutput schema / properties / results / items / properties / user_unresolved
      Added value: +{
      +  "description": "True when `user` is a raw Slack id, not a name",
      +  "type": "boolean"
      +}
  3. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnly/non-destructive, yet the description adds genuinely non-obvious behavior: hits marked `[body not included in this search result]` with `body_missing: true` did match and must not be reported as empty, and DMs return unresolved ids. That is exactly the kind of trap an agent would otherwise fall into.

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?

Four sentences, purpose first, then the caveats that matter. The marker-sentence is dense but every clause is load-bearing; no filler or repetition of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-shape explanation is unnecessary, and the description covers the two real failure modes (phantom empty messages, unresolved DM names). Pagination behavior is left to the schema's limit field, which is acceptable but the only remaining gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the query parameter's description already carries the word-match vs. substring nuance, so the schema does the heavy lifting. The description only restates the optional channel_id restriction, adding no syntax, limits, or defaults beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Searches Slack messages") plus the scoping option (channel_id). It also distinguishes itself from slack_read_channel_messages and slack_list_channels by describing what those tools are for, though it never contrasts the query semantics against the plain `search_messages` sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: use slack_read_channel_messages for hits with missing bodies and slack_list_channels to resolve DM ids. It gives clear downstream context but never states when to search here versus reading a channel directly, so the when-not case is only implied.

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