Skip to main content
Glama

discord_search_guild_messages

Read-only

Search all channels in a Discord guild for messages matching a query, returning up to 25 results with channel context and optional author or channel filters.

Instructions

Search for messages across all channels in a guild using Discord's native search API. Returns at most 25 messages matching the query with channel context, with no way to page past them. Age-restricted (NSFW) channels are left out. Requires the Read Message History permission and the Message Content privileged intent, enabled in the Developer Portal. While Discord is still building the server's search index, the call fails and says how many seconds to wait. Use discord_search_messages for a substring scan of one channel's last 100 messages. To read the messages around a hit, use discord_read_messages with around.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "guild_id": "<guild_id>",
      "query": "<query>"
    },
    "name": "discord_search_guild_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax messages to return (1–25). Default 25.
queryYesSearch query (case-insensitive).
guild_idYesDiscord server (guild) ID (snowflake).
author_idNoOptional. Only show messages from this user ID.
channel_idNoOptional. Restrict search to this channel ID.

Output Schema

NameRequiredDescriptionDefault
matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.3.0
    • addedOutput schema / properties / matches / items / properties / author_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / matches / items / properties / webhook_id
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / matches / items / required
      Previous value: -[
      -  "id",
      -  "author",
      -  "content",
      -  "timestamp",
      -  "channel_id",
      -  "channel_name"
      -]New value: +[
      +  "id",
      +  "author",
      +  "author_id",
      +  "content",
      +  "timestamp",
      +  "channel_id",
      +  "channel_name"
      +]
  2. Changed1 schema field changedv2.2.1
    • addedOutput schema / properties / matches / items / properties / embeds
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "author": {
      +        "type": "string"
      +      },
      +      "description": {
      +        "type": "string"
      +      },
      +      "fields": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "name": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "name",
      +            "value"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "footer": {
      +        "type": "string"
      +      },
      +      "moreFields": {
      +        "description": "Count of fields left out past the first 10. Absent when none were.",
      +        "type": "number"
      +      },
      +      "title": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Addedv2.2.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations by disclosing the 25-message hard cap with no pagination, exclusion of NSFW channels, required Read Message History permission plus the Message Content privileged intent, and a specific failure mode while the search index builds that reports a wait time. These are the operational facts an agent needs before committing to the call.

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?

Front-loads the core action and scope, then layers constraints, prerequisites, failure behavior, and sibling routing. Every sentence carries distinct information — even the apparent restatement of the 25 cap adds the non-obvious fact that pagination is unavailable.

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?

An output schema exists, so return formatting need not be explained, and the description still covers the remaining burdens: permissions, privileged intent, truncation, channel exclusions, and the index-building failure. Nothing an agent needs to call this correctly or interpret a failure is missing.

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 description coverage is 100%, so all five parameters including limit, author_id, and channel_id are already documented in the schema. The description adds no per-parameter meaning beyond restating the overall cap, so the baseline of 3 applies; it neither compensates for a gap nor contradicts the schema.

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 with explicit scope: 'Search for messages across all channels in a guild using Discord's native search API.' It also implicitly separates itself from single-channel search by specifying 'across all channels,' so an agent can distinguish it from discord_search_messages without opening either schema.

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?

Names the exact alternative and the condition that selects it: 'Use discord_search_messages for a substring scan of one channel's last 100 messages.' It also routes follow-up work explicitly ('To read the messages around a hit, use discord_read_messages with around'), covering both when to use this tool and what to do next.

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