Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_login

Authenticate with Discord using a configured token to enable AI assistants to interact with Discord platforms for messaging, channel management, and webhook handling.

Instructions

Logs in to Discord using the configured token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringNo

Implementation Reference

  • The main handler for the discord_login tool. Parses optional random_string arg (unused), checks if client is ready, logs in using client.login(config.DISCORD_TOKEN), returns success message with user tag or error.
    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
        };
      }
    }
  • Zod validation schema for the tool's input: optional random_string.
    const DiscordLoginSchema = z.object({
        random_string: z.string().optional()
    });
  • src/index.ts:195-204 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and input schema matching the Zod schema.
    {
      name: "discord_login",
      description: "Logs in to Discord using the configured token",
      inputSchema: {
        type: "object",
        properties: {
          random_string: { type: "string" }
        },
        required: []
      }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions authentication but doesn't describe what 'logging in' entails operationally: whether it establishes a session, what permissions are granted, if there are rate limits, error conditions, or what happens on success/failure. For an authentication tool with zero annotation coverage, this is insufficient.

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 gets straight to the point with zero wasted words. It's appropriately sized for a simple authentication tool and front-loads the core functionality.

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 an authentication tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain what successful login enables, what the output looks like, error handling, or dependencies. Given the complexity of authentication and lack of structured documentation, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'configured token' but doesn't explain the 'random_string' parameter at all. The description doesn't clarify if 'random_string' relates to the token, is a session identifier, or serves another purpose. With 1 undocumented parameter, the description adds minimal value beyond the schema.

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 ('Logs in') and target resource ('to Discord'), specifying it uses 'the configured token'. It distinguishes from siblings by focusing on authentication rather than message/channel operations. However, it doesn't explicitly differentiate from potential alternative login methods.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a token configured first), when authentication is required, or what happens if already logged in. It simply states what the tool does without contextual usage information.

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

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