Skip to main content
Glama

discord_search_messages

Read-only

Search a Discord channel's recent messages by keyword using case-insensitive substring matching. Scans up to the last 100 messages and returns matching author, content, and timestamp.

Instructions

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. Use discord_read_messages to fetch recent messages without filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax number of recent messages to scan (1–100). Default 100.
keywordYesCase-insensitive substring to match within message content.
channel_idYesID (snowflake) of the channel or thread to search.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed6 schema fields changedv2.0.0
    • addedInput schema / properties / channel_id / pattern
      Added value: +"^\\d{17,20}$"
    • addedInput schema / properties / limit / default
      Added value: +100
    • addedInput schema / properties / limit / maximum
      Added value: +100
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "matches": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "author": {
      +            "type": "string"
      +          },
      +          "content": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "timestamp": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "author",
      +          "content",
      +          "timestamp"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "matches"
      +  ],
      +  "type": "object"
      +}
  3. Changed3 schema fields changedv1.6.0
    • addedInput schema / properties / channel_id / description
      Added value: +"ID (snowflake) of the channel or thread to search."
    • addedInput schema / properties / keyword / description
      Added value: +"Case-insensitive substring to match within message content."
    • changedInput schema / properties / limit / description
      Previous value: -"Max messages to scan (default 100)."New value: +"Max number of recent messages to scan (1–100). Default 100."
  4. Addedv1.5.0
  5. Removedv1.0.0
  6. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With readOnlyHint=true already covering the safety profile, the description adds meaningful behavioral context: the 100-message scan cap, the non-full-history limitation, and the exact return shape { matches: [...] } with field names. This goes beyond the annotations and tells the agent what actually happens at runtime.

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?

Four dense sentences (~65 words) with nothing wasted. Core purpose is front-loaded, followed by the critical limitation, the return shape, and the sibling routing. Every sentence earns its place.

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 low-complexity filtered-read tool, the description is nearly complete: it covers purpose, semantics, scope limits, return format, and an alternative tool, while annotations and output schema handle safety and response structure. The only gap is not distinguishing from discord_search_guild_messages (guild-wide vs. channel-local search), though the phrase 'a channel's recent messages' largely implies it.

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 three parameters (channel_id, keyword, limit) are already documented in the input schema. The description reinforces the keyword semantics and contextualizes the limit with 'Scans only up to the last 100 messages,' but adds no new parameter syntax or format details. Baseline 3 applies as schema does the heavy lifting.

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 ('search'), a precise resource ('a channel's recent messages'), and the matching mechanism ('case-insensitive substring matching'). The channel-scoped phrasing distinguishes it from discord_search_guild_messages, and it explicitly names discord_read_messages as the unfiltered alternative, so an agent can tell them apart immediately.

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?

Provides clear context: use when you need keyword filtering over a channel's recent messages. Names discord_read_messages as the alternative when no filtering is needed and states an explicit exclusion ('does not search full history'). However, it does not mention the guild-wide search sibling (discord_search_guild_messages) for broader search needs.

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