Skip to main content
Glama
cloud-ru-tech

mcp-server-mattermost

search_messages

Read-onlyIdempotent

Search Mattermost messages across channels using criteria like text, user, channel, or date. Locate specific posts with query syntax such as from:username or after:2024-01-01.

Instructions

Search for messages matching specific criteria across channels.

Searches message content within a team. For simply reading recent channel messages, use get_channel_messages instead.

Search syntax examples:

  • Simple text: "deployment error"

  • From user: "from:username bug"

  • In channel: "in:channel-name release"

  • Date range: "after:2024-01-01 before:2024-02-01"

  • Combined: "from:alice in:dev-ops deployment failed"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termsYesSearch terms (Mattermost syntax)
team_idYes26-character team identifier (e.g., 'o5w8h47pdfbzjc4d8w7dhnhren')
is_or_searchNoUse OR instead of AND for multiple terms

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderYesPost IDs in display order
postsYesMap of post ID to Post object
truncatedNoTrue when the response hit a Mattermost response cap — more posts exist beyond this batch
next_post_idNoNext post ID for pagination
prev_post_idNoPrevious post ID for pagination

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.1
    • changedOutput schema / properties / posts / additionalProperties / required
      Previous value: -[
      -  "id",
      -  "create_at",
      -  "update_at",
      -  "delete_at",
      -  "edit_at",
      -  "user_id",
      -  "channel_id",
      -  "root_id",
      -  "original_id",
      -  "message",
      -  "type",
      -  "hashtags",
      -  "file_ids",
      -  "pending_post_id",
      -  "is_pinned"
      -]New value: +[
      +  "id",
      +  "create_at",
      +  "update_at",
      +  "delete_at",
      +  "edit_at",
      +  "user_id",
      +  "channel_id",
      +  "root_id",
      +  "original_id",
      +  "message",
      +  "type",
      +  "hashtags",
      +  "pending_post_id",
      +  "is_pinned"
      +]
  2. First observedv0.5.1

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare the operation read-only and idempotent, lowering the burden. The description adds useful behavioral scope beyond annotations by clarifying that search spans a whole team and all channels, not just the current channel.

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

Conciseness5/5

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

The description is well-structured and front-loaded: purpose first, sibling distinction second, then compact syntax examples. Every line earns its place with no filler or redundancy.

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?

Given the output schema exists, the description does not need to explain return values. The combination of purpose, usage guidance, alternative routing, syntax examples, and schema details fully equips an agent to invoke this tool correctly.

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 baseline is 3, but the description significantly adds value with search syntax examples for the terms parameter: simple text, from, in, date range, and combined queries. This helps an agent construct valid and effective search terms beyond what the schema states.

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 clear verb and resource: searching messages across channels within a team. It also distinguishes itself from get_channel_messages, making the tool's scope explicit and easy to differentiate from siblings.

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?

The description explicitly tells the agent when to use this tool versus the main alternative: use search_messages for searching content across channels, and use get_channel_messages for simply reading recent channel messages. This gives concrete routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.