Skip to main content
Glama
Discord MCP - Discord server management MCP for AI agents

Discord MCP - Discord server management MCP for AI agents

Search messages

search_messages
Read-only

Search Discord message history across readable channels or one channel, including embeds and polls, then filter by author, content type, or pinned status and sort by newest or relevance.

Instructions

Search the server's message history through Discord's native search index. Covers every channel the bot can read, or one channel if you name it, and looks inside embeds and polls, not just plain text. Matching is whole-word full text, not substring, so search for words rather than fragments. Filter by author, by what a message carries (image, link, file, and so on), or by pinned state, and order by newest first or by relevance.

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
hasNoOnly messages that carry this kind of content.
sortNoOrder by newest first (recent, the default) or best match (relevant).
guildNoGuild (server) name or ID. Omit to use the default guild.
limitNoMax results to return, 1 to 25. Default 10.
queryNoWords to look for. Whole-word full text match, not substring. Optional if you filter by author, has, or pinned instead.
authorNoOnly messages from this member (name or ID).
offsetNoSkip this many results, for paging. Default 0.
pinnedNoOnly pinned (true) or only unpinned (false) messages.
channelNoLimit to one channel by name or ID. Default: the whole server.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.2
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv1.3.0
    • removedInput schema / additionalProperties
      Removed value: -false
  3. Changed12 schema fields changedv1.1.2
    • changedInput schema / properties / author / description
      Previous value: -"Only messages whose author name matches this."New value: +"Only messages from this member (name or ID)."
    • changedInput schema / properties / channel / description
      Previous value: -"Channel name or ID to search in."New value: +"Limit to one channel by name or ID. Default: the whole server."
    • addedInput schema / properties / has
      Added value: +{
      +  "description": "Only messages that carry this kind of content.",
      +  "enum": [
      +    "image",
      +    "video",
      +    "sound",
      +    "file",
      +    "sticker",
      +    "embed",
      +    "link",
      +    "poll",
      +    "snapshot"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Max results. Default 10."New value: +"Max results to return, 1 to 25. Default 10."
    • changedInput schema / properties / limit / maximum
      Previous value: -50New value: +25
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Skip this many results, for paging. Default 0.",
      +  "maximum": 9975,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / pinned
      Added value: +{
      +  "description": "Only pinned (true) or only unpinned (false) messages.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / query / description
      Previous value: -"Text to look for."New value: +"Words to look for. Whole-word full text match, not substring. Optional if you filter by author, has, or pinned instead."
    • addedInput schema / properties / query / maxLength
      Added value: +1024
    • removedInput schema / properties / scan_limit
      Removed value: -{
      -  "description": "How many messages to scan before stopping. Default 300.",
      -  "maximum": 1000,
      -  "minimum": 50,
      -  "type": "integer"
      -}
    • addedInput schema / properties / sort
      Added value: +{
      +  "description": "Order by newest first (recent, the default) or best match (relevant).",
      +  "enum": [
      +    "recent",
      +    "relevant"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "channel",
      -  "query"
      -]
  4. First observedv1.0.2

TDQS

A4.1/5.0
Behavior4/5

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

With readOnlyHint=true already declaring a safe read, the description still adds real behavior: the search runs against Discord's native index, covers only channels the bot can read, and reaches inside embeds and polls rather than plain text alone. The whole-word (not substring) matching rule is a non-obvious behavioral constraint that will change how agents phrase queries. Missing only operational details like rate limits or result shape.

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?

Three sentences, front-loaded with purpose and scope before matching semantics and filters. Every clause carries information an agent would otherwise have to guess at, and there is no filler or restatement of the tool name.

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?

For a 9-parameter, zero-required read tool with annotations covering safety, the description supplies the important context: index-backed search, channel scope, matching rules, filter families, and ordering. Since no output schema exists, a brief note on what a result contains (message, channel, author, timestamp) would close the remaining gap.

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 adds meaning beyond the schema: it explains that matching is whole-word full text and that query may be dropped entirely in favor of author, content-type, or pinned filters. It groups the filters conceptually ('by author, by what a message carries, or by pinned state') and states the two sort orders in prose, reinforcing rather than merely repeating the enums. It does not detail limit/offset paging semantics, which the schema already covers.

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?

The description names a specific verb and resource ('Search the server's message history') and pins down the mechanism ('Discord's native search index'), so the agent knows exactly what is being queried. Scope is also stated ('every channel the bot can read, or one channel if you name it'). It stops short of naming a sibling such as read_messages or list_pinned_messages to route against, which keeps it at 4.

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?

Clear context is given for when this tool is the right call: full-text indexed lookup with whole-word matching, and the explicit caution to 'search for words rather than fragments'. It also clarifies that query is optional when filtering by author, has, or pinned, which is genuine usage guidance. There is no explicit when-not or named alternative tool, so it does not reach 5.

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