Skip to main content
Glama
discord-mcp

discord-mcp

by zongwei-tang

search_messages

Read-only

Search Discord messages in a server or channel by text, author, mentions, attachments, or date range, and filter results to pinned messages.

Instructions

Search messages like the Discord search bar: in a server (guild_id) or a DM/channel (channel_id). Filter by text, author, mentions, attachments/links (has), channel, date range, pinned.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
hasNoMessage has: link, embed, poll, file, video, image, sound, sticker, snapshot (forward)
afterNoAfter this date (ISO8601)
limitNo1-25 (default 25)
beforeNoBefore this date (ISO8601)
offsetNoPagination offset (multiples of 25)
pinnedNo
contentNoText to search for
sort_byNo
guild_idNoServer to search in
mentionsNoMentioning these user IDs
author_idNoFrom these user IDs
channel_idNoLimit to this channel (or search a DM/group DM by its channel ID without guild_id)
sort_orderNo
author_typeNouser, bot, webhook (prefix - to exclude)
include_nsfwNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, and destructiveHint=false, so the description need not restate safety. It adds scope and filter behavior but omits pagination limits, rate limits, permission requirements, and what results look like; with no output schema, some behavioral detail is missing but not critical.

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?

Single tightly written sentence with the primary scope and filter set front-loaded. The Discord analogy earns its place by making the filter model immediately recognizable.

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

Completeness3/5

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

For a 15-parameter search tool, the description covers the main modes and filter families, which is adequate given the 73% schema coverage and safety annotations. It leaves out result format, pagination defaults, and whether any filter is required, so it is not fully self-contained.

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 73%, so the schema already documents most parameters. The description usefully groups filter categories (text, author, mentions, has, channel, date range, pinned) but does not clarify sort_by/sort_order, offset, author_type exclusion, or include_nsfw beyond what the schema provides.

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?

States a specific verb and resource and defines two search scopes (server via guild_id vs DM/channel via channel_id), using the Discord search-bar analogy to set expectations. This is enough to distinguish it from read_messages or list_saved_messages 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 Guidelines3/5

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

Provides clear context that this is a filtered message search with server and DM/channel modes, but never names alternatives such as read_messages or search_threads or states when not to use it. Usage is implied rather than explicitly routed.

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

Deploy Server

Other Tools