Skip to main content
Glama
drvova

Discord MCP Server

discord_get_message_history

Retrieve message history from Discord channels with filtering options to analyze conversations, track discussions, or review past interactions.

Instructions

Get message history from a Discord channel with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
limitNoNumber of messages to retrieve (1-100, default: 50)
beforeNoGet messages before this message ID
afterNoGet messages after this message ID
aroundNoGet messages around this message ID

Implementation Reference

  • Dynamic dispatching for tool execution: converts snake_case tool names like 'get_message_history' to camelCase 'getMessageHistory' and calls the corresponding method on AutomationManager.
    private async callAutomationMethod(action: string, params: any): Promise<string> {
      // Convert action name to method name (snake_case to camelCase)
      const methodName = action.replace(/_([a-z])/g, (g) => g[1].toUpperCase());
      
      // Check if method exists
      if (typeof (this.automationManager as any)[methodName] === 'function') {
        // Call the method with params
        return await (this.automationManager as any)[methodName](...Object.values(params));
      }
      
      throw new Error(`Method '${methodName}' not found in AutomationManager`);
    }
  • Core handler function for 'discord_get_message_history' tool: validates input parameters and fetches message history from Discord channel using DiscordService.
    async getMessageHistory(channelId?: string, limit?: number, before?: string, after?: string): Promise<string> {
      const parsed = schemas.GetMessageHistorySchema.parse({ channelId, limit, before, after });
      return await this.discordService.getMessageHistory(parsed.channelId, parsed.limit, parsed.before, parsed.after);
    }
  • Input schema (Zod) for the tool, validating channelId (required string) and optional limit, before, after parameters.
    export const GetMessageHistorySchema = z.object({
      channelId: z.string().describe("Channel ID"),
      limit: z.number().optional().describe("Number of messages to fetch"),
      before: z.string().optional().describe("Message ID to fetch before"),
      after: z.string().optional().describe("Message ID to fetch after")
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe important behavioral traits: whether this is a read-only operation, rate limits, authentication requirements, pagination behavior, error conditions, or what the return format looks like. For a tool with 5 parameters and no output schema, this leaves significant gaps in understanding how the tool behaves.

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?

The description is a single, efficient sentence that states the core purpose upfront. There's no wasted language or unnecessary elaboration. It's appropriately sized for a tool with this level of complexity and gets straight to the point without sacrificing clarity.

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

Completeness2/5

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

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, error handling, rate limits, or authentication requirements. While the schema covers parameter documentation well, the description fails to provide the behavioral context needed for an agent to use this tool effectively in real scenarios.

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?

The description mentions 'optional filtering' which hints at the purpose of parameters like before, after, and around, but doesn't explain their semantics or relationships. With 100% schema description coverage, the schema already documents all parameters well, so the description adds minimal value beyond what's in the structured data. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 clearly states the verb ('Get') and resource ('message history from a Discord channel'), making the purpose immediately understandable. It distinguishes this tool from siblings like discord_get_message (singular) and discord_search_messages by specifying it retrieves historical messages rather than a single message or search results. However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions 'optional filtering' but doesn't specify when to use filtering parameters or how this differs from discord_search_messages. There's no mention of prerequisites, limitations, or typical use cases, leaving the agent with insufficient context for optimal tool selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/drvova/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server