Skip to main content
Glama
scarecr0w12

discord-mcp

get_invite_info

Retrieve detailed information about a Discord invite using its code, including server details and usage statistics.

Instructions

Get information about a specific invite

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inviteCodeYesThe invite code (without discord.gg/)

Implementation Reference

  • The handler function that executes the tool logic: fetches Discord invite info using client.fetchInvite(inviteCode), structures the data (guild, channel, inviter, counts, etc.), handles errors with withErrorHandling, and returns JSON response.
    async ({ inviteCode }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const invite = await client.fetchInvite(inviteCode);
    
        return {
          code: invite.code,
          url: invite.url,
          guildId: invite.guild?.id,
          guildName: invite.guild?.name,
          guildDescription: invite.guild?.description,
          channelId: invite.channelId,
          channelName: invite.channel?.name,
          channelType: invite.channel?.type,
          inviterId: invite.inviterId,
          inviterUsername: invite.inviter?.username,
          approximateMemberCount: invite.memberCount,
          approximatePresenceCount: invite.presenceCount,
          expiresAt: invite.expiresAt?.toISOString(),
          targetType: invite.targetType,
        };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Input schema defined with Zod: requires 'inviteCode' as a string describing the invite code without the discord.gg/ prefix.
      inviteCode: z.string().describe('The invite code (without discord.gg/)'),
    },
  • Registers the 'get_invite_info' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      'get_invite_info',
      'Get information about a specific invite',
      {
        inviteCode: z.string().describe('The invite code (without discord.gg/)'),
      },
      async ({ inviteCode }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const invite = await client.fetchInvite(inviteCode);
    
          return {
            code: invite.code,
            url: invite.url,
            guildId: invite.guild?.id,
            guildName: invite.guild?.name,
            guildDescription: invite.guild?.description,
            channelId: invite.channelId,
            channelName: invite.channel?.name,
            channelType: invite.channel?.type,
            inviterId: invite.inviterId,
            inviterUsername: invite.inviter?.username,
            approximateMemberCount: invite.memberCount,
            approximatePresenceCount: invite.presenceCount,
            expiresAt: invite.expiresAt?.toISOString(),
            targetType: invite.targetType,
          };
        });
    
        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:62-62 (registration)
    Calls registerInviteTools(server) in the main MCP server setup, which registers the get_invite_info tool along with other invite management tools.
    registerInviteTools(server);
  • src/index.ts:19-19 (registration)
    Imports the registerInviteTools function used to register invite tools including get_invite_info.
    import { registerInviteTools } from './tools/invite-tools.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action is 'Get information', implying a read-only operation, but doesn't clarify if it requires specific permissions, has rate limits, or what the output format looks like. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information.

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 tool's complexity (simple read operation with one parameter) and the absence of annotations and output schema, the description is incomplete. It doesn't explain what information is returned (e.g., JSON structure, fields like 'uses' or 'expires_at'), leaving the agent unsure of the output. For a tool with no structured output documentation, the description should compensate more.

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 input schema has 100% description coverage, with the parameter 'inviteCode' documented as 'The invite code (without discord.gg/)'. The description adds no additional meaning beyond this, such as format examples or validation rules. With high schema coverage, the baseline score of 3 is appropriate as 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 the resource 'information about a specific invite', making the purpose understandable. It distinguishes from siblings like 'create_invite' and 'delete_invite' by focusing on retrieval rather than creation or deletion. However, it doesn't specify what type of information is retrieved (e.g., creator, usage count, expiration), keeping it from being fully specific.

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 doesn't mention when this tool is appropriate (e.g., for checking invite details) or when not to use it (e.g., for listing all invites, which 'list_invites' handles). Without such context, an agent must infer usage from the tool name 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