Skip to main content
Glama
scarecr0w12

discord-mcp

create_event

Schedule events in Discord servers by specifying details like name, time, type, and location for voice, stage, or external gatherings.

Instructions

Create a scheduled event in a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
nameYesName of the event
descriptionNoDescription of the event
scheduledStartTimeYesStart time in ISO 8601 format
scheduledEndTimeNoEnd time in ISO 8601 format (required for external events)
entityTypeYesType of event
channelIdNoChannel ID for voice/stage events
locationNoLocation for external events
imageNoURL of the cover image
reasonNoReason for creating

Implementation Reference

  • The core handler function that implements the 'create_event' tool. It fetches the Discord guild, maps the entity type, constructs event creation options, calls guild.scheduledEvents.create(), and returns the created event details or error.
    async ({ guildId, name, description, scheduledStartTime, scheduledEndTime, entityType, channelId, location, image, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
    
        const entityTypeMap: Record<string, GuildScheduledEventEntityType> = {
          'STAGE_INSTANCE': GuildScheduledEventEntityType.StageInstance,
          'VOICE': GuildScheduledEventEntityType.Voice,
          'EXTERNAL': GuildScheduledEventEntityType.External,
        };
    
        const eventOptions: {
          name: string;
          scheduledStartTime: string;
          privacyLevel: GuildScheduledEventPrivacyLevel;
          entityType: GuildScheduledEventEntityType;
          description?: string;
          scheduledEndTime?: string;
          channel?: string;
          entityMetadata?: { location: string };
          image?: string;
          reason?: string;
        } = {
          name,
          scheduledStartTime,
          privacyLevel: GuildScheduledEventPrivacyLevel.GuildOnly,
          entityType: entityTypeMap[entityType],
        };
    
        if (description) eventOptions.description = description;
        if (scheduledEndTime) eventOptions.scheduledEndTime = scheduledEndTime;
        if (channelId) eventOptions.channel = channelId;
        if (location) eventOptions.entityMetadata = { location };
        if (image) eventOptions.image = image;
        if (reason) eventOptions.reason = reason;
    
        const event = await guild.scheduledEvents.create(eventOptions);
    
        return {
          id: event.id,
          name: event.name,
          scheduledStartTime: event.scheduledStartAt?.toISOString(),
          entityType: GuildScheduledEventEntityType[event.entityType],
          url: event.url,
          message: 'Event created successfully',
        };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod input schema defining parameters for the create_event tool, including guildId, name, times, entityType, etc.
      guildId: z.string().describe('The ID of the server (guild)'),
      name: z.string().describe('Name of the event'),
      description: z.string().optional().describe('Description of the event'),
      scheduledStartTime: z.string().describe('Start time in ISO 8601 format'),
      scheduledEndTime: z.string().optional().describe('End time in ISO 8601 format (required for external events)'),
      entityType: z.enum(['STAGE_INSTANCE', 'VOICE', 'EXTERNAL']).describe('Type of event'),
      channelId: z.string().optional().describe('Channel ID for voice/stage events'),
      location: z.string().optional().describe('Location for external events'),
      image: z.string().optional().describe('URL of the cover image'),
      reason: z.string().optional().describe('Reason for creating'),
    },
  • The server.tool() invocation that registers the 'create_event' tool on the MCP server, providing name, description, input schema, and handler function.
    server.tool(
      'create_event',
      'Create a scheduled event in a server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        name: z.string().describe('Name of the event'),
        description: z.string().optional().describe('Description of the event'),
        scheduledStartTime: z.string().describe('Start time in ISO 8601 format'),
        scheduledEndTime: z.string().optional().describe('End time in ISO 8601 format (required for external events)'),
        entityType: z.enum(['STAGE_INSTANCE', 'VOICE', 'EXTERNAL']).describe('Type of event'),
        channelId: z.string().optional().describe('Channel ID for voice/stage events'),
        location: z.string().optional().describe('Location for external events'),
        image: z.string().optional().describe('URL of the cover image'),
        reason: z.string().optional().describe('Reason for creating'),
      },
      async ({ guildId, name, description, scheduledStartTime, scheduledEndTime, entityType, channelId, location, image, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
    
          const entityTypeMap: Record<string, GuildScheduledEventEntityType> = {
            'STAGE_INSTANCE': GuildScheduledEventEntityType.StageInstance,
            'VOICE': GuildScheduledEventEntityType.Voice,
            'EXTERNAL': GuildScheduledEventEntityType.External,
          };
    
          const eventOptions: {
            name: string;
            scheduledStartTime: string;
            privacyLevel: GuildScheduledEventPrivacyLevel;
            entityType: GuildScheduledEventEntityType;
            description?: string;
            scheduledEndTime?: string;
            channel?: string;
            entityMetadata?: { location: string };
            image?: string;
            reason?: string;
          } = {
            name,
            scheduledStartTime,
            privacyLevel: GuildScheduledEventPrivacyLevel.GuildOnly,
            entityType: entityTypeMap[entityType],
          };
    
          if (description) eventOptions.description = description;
          if (scheduledEndTime) eventOptions.scheduledEndTime = scheduledEndTime;
          if (channelId) eventOptions.channel = channelId;
          if (location) eventOptions.entityMetadata = { location };
          if (image) eventOptions.image = image;
          if (reason) eventOptions.reason = reason;
    
          const event = await guild.scheduledEvents.create(eventOptions);
    
          return {
            id: event.id,
            name: event.name,
            scheduledStartTime: event.scheduledStartAt?.toISOString(),
            entityType: GuildScheduledEventEntityType[event.entityType],
            url: event.url,
            message: 'Event created successfully',
          };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • src/index.ts:63-63 (registration)
    Invocation of registerEventTools(server) in the main MCP server setup, which registers the event tools including 'create_event'.
    registerEventTools(server);
  • src/index.ts:20-20 (registration)
    Import of registerEventTools from event-tools.ts, enabling registration of the create_event tool.
    import { registerEventTools } from './tools/event-tools.js';
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 the action ('create') but lacks critical details: it doesn't mention required permissions, whether the operation is idempotent, error conditions, or what happens on success (e.g., returns an event ID). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 front-loads the core purpose without unnecessary words. Every word earns its place, making it easy to parse quickly while avoiding under-specification.

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?

Given the complexity (10 parameters, mutation operation) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or response format, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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 the schema already documents all 10 parameters thoroughly. The description adds no additional parameter semantics beyond implying 'scheduled event' context, which is redundant with the schema. Baseline 3 is appropriate when the schema does the heavy lifting, though no extra value is added.

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 action ('create') and resource ('scheduled event in a server'), making the purpose immediately understandable. It distinguishes from siblings like 'modify_event' or 'delete_event' by specifying creation, though it doesn't explicitly contrast with alternatives like 'create_channel' or 'create_role' beyond the resource type.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., permissions needed), when not to use it, or how it differs from similar tools like 'modify_event' for updates. This leaves the agent to infer usage from the name and context alone.

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/scarecr0w12/discord-mcp'

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