messages/send.ts

cappyeo/discord-mcp · packages/mcp-core/src/tools/messages/send.ts · typescript · Apache-2.0
voice

Discord MCP tool that sends a plain-text message to a channel with validation and returns a jump URL.

// Source: https://github.com/cappyeo/discord-mcp | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { container } from '@sapphire/pieces';
import { Routes } from 'discord-api-types/v10';
import { z } from 'zod';
import { defineTool } from '../_lib/defineTool.js';
import { messageJumpUrl } from '../_lib/message-jump-url.js';
import { dualResult } from '../_lib/response.js';
import { ChannelId, MessageId } from '../_lib/snowflake.js';

interface DiscordMessageResponse {
  id: string;
  channel_id: string;
  content: string;
  timestamp: string;
  guild_id?: string;
}

export default defineTool({
  name: 'messages_send',
  category: 'messages',
  description: [
    '**Purpose**:

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key