discord_login
Authenticate with Discord by using a configured token to enable AI assistants to perform actions like messaging, managing channels, and handling webhooks.
Instructions
Logs in to Discord using the configured token
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | No |
Implementation Reference
- src/index.ts:72-74 (schema)Zod schema for validating input arguments to the discord_login tool (random_string optional).const DiscordLoginSchema = z.object({ random_string: z.string().optional() });
- src/index.ts:195-204 (registration)Tool registration in the MCP server's listTools response, including name, description, and input schema.{ name: "discord_login", description: "Logs in to Discord using the configured token", inputSchema: { type: "object", properties: { random_string: { type: "string" } }, required: [] }
- src/index.ts:475-504 (handler)Main handler logic for discord_login: validates args, checks login status, performs Discord client login using config token, handles success/error responses.case "discord_login": { const { random_string } = DiscordLoginSchema.parse(args); try { // Check if already logged in if (client.isReady()) { return { content: [{ type: "text", text: `Already logged in as ${client.user?.tag}` }] }; } // Try to login await client.login(config.DISCORD_TOKEN); return { content: [{ type: "text", text: `Successfully logged in as ${client.user?.tag}` }] }; } catch (error) { return { content: [{ type: "text", text: `Login failed: ${error}` }], isError: true }; } }