discord-mcp

Search messages

discord_search_messages

Read-only

Toolset
Messages messages
Discord permissions
View Channel and Read Message History
Context cost
557 tokens, estimated2,228 bytes of definition, divided by 4

Keyword search over a channel's recent messages using case-insensitive substring matching. Scans only up to the last 100 messages; it does not search full history. Returns { matches: [...] } with id, author, content, timestamp, and the text of any embeds. Matching checks message content only, so a word that appears only in an embed is not found. Requires the View Channel and Read Message History permissions; without Read Message History an empty scan fails with an error naming the permission. Use discord_read_messages to fetch recent messages without filtering. To search full history, in one channel or the whole server, use discord_search_guild_messages.

Risk and annotations

Read-onlyreadOnlyHintyesDoes not modify your server.
DestructivedestructiveHintn/aNot declared: it only applies to tools that write.
IdempotentidempotentHintn/aNot declared.
Open worldopenWorldHintyesInteracts with an external system: Discord.

Annotations are hints the server declares. Clients use them to decide when to ask you before a call.

Parameters

ParameterTypeRulesDescription
channel_idrequiredstring
pattern ^\d{17,20}$
ID (snowflake) of the channel or thread to search.
keywordrequiredstring
none
Case-insensitive substring to match within message content.
limitoptionalinteger
1 to 100default 100
Max number of recent messages to scan (1–100). Default 100.

Output

Declared by outputSchema: clients receive this shape as structuredContent.

FieldTypeDescription
matchesrequiredarray of objects
id (nested, level 1)requiredstring
author (nested, level 1)requiredstring
author_id (nested, level 1)requiredstring
webhook_id (nested, level 1)string
content (nested, level 1)requiredstring
timestamp (nested, level 1)requiredstring
embeds (nested, level 1)array of objects
title (nested, level 2)string
author (nested, level 2)string
description (nested, level 2)string
url (nested, level 2)string
fields (nested, level 2)array of objects
name (nested, level 3)requiredstring
value (nested, level 3)requiredstring
moreFields (nested, level 2)numberCount of fields left out past the first 10. Absent when none were.
footer (nested, level 2)string

Related tools

Named in its description

Also in Messages

Raw definition (2,228 bytes)
{
  "name": "discord_search_messages",
  "description": "Keyword search over a channel's recent messages using case-insensitive substring matching. Scans only up to the last 100 messages; it does not search full history. Returns { matches: [...] } with id, author, content, timestamp, and the text of any embeds. Matching checks message content only, so a word that appears only in an embed is not found. Requires the View Channel and Read Message History permissions; without Read Message History an empty scan fails with an error naming the permission. Use discord_read_messages to fetch recent messages without filtering. To search full history, in one channel or the whole server, use discord_search_guild_messages.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "channel_id": {
        "type": "string",
        "pattern": "^\\d{17,20}$",
        "description": "ID (snowflake) of the channel or thread to search."
      },
      "keyword": {
        "type": "string",
        "description": "Case-insensitive substring to match within message content."
      },
      "limit": {
        "default": 100,
        "description": "Max number of recent messages to scan (1–100). Default 100.",
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      }
    },
    "required": [
      "channel_id",
      "keyword"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "properties": {
      "matches": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "author": {
              "type": "string"
            },
            "author_id": {
              "type": "string"
            },
            "webhook_id": {
              "type": "string"
            },
            "content": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            },
            "embeds": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "author": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "moreFields": {
                    "description": "Count of fields left out past the first 10. Absent when none were.",
                    "type": "number"
                  },
                  "footer": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": [
            "id",
            "author",
            "author_id",
            "content",
            "timestamp"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "matches"
    ],
    "additionalProperties": false
  },
  "annotations": {
    "title": "Search messages",
    "readOnlyHint": true,
    "openWorldHint": true
  }
}